diff --git a/wax-prosemirror-services/src/FullScreenService/components/FullScreenButton.js b/wax-prosemirror-services/src/FullScreenService/components/FullScreenButton.js index 5e55c4310b8583c5ab9a163422053a51bec1c2c2..37c84155eadd9997e7482093730beaa0e491b91f 100644 --- a/wax-prosemirror-services/src/FullScreenService/components/FullScreenButton.js +++ b/wax-prosemirror-services/src/FullScreenService/components/FullScreenButton.js @@ -1,11 +1,14 @@ /* eslint react/prop-types: 0 */ import React, { useContext, useMemo } from 'react'; +import { isEmpty } from 'lodash'; +import { useTranslation } from 'react-i18next'; import { TextSelection } from 'prosemirror-state'; import { WaxContext, MenuButton } from 'wax-prosemirror-core'; const FullScreenButton = ({ view = {}, item }) => { - const { active, icon, select } = item; + const { t, i18n } = useTranslation(); + const { active, icon, label, select, title } = item; const context = useContext(WaxContext); const { activeViewId, activeView, options } = context; @@ -27,8 +30,8 @@ const FullScreenButton = ({ view = {}, item }) => { }; const usedIcon = options.fullScreen ? 'fullScreenExit' : icon; + const titleToshow = options.fullScreen ? 'Exit full screen' : title; const isActive = active(state, activeViewId) && select(state, activeViewId); - const isDisabled = !select(state, activeViewId, activeView); const MenuButtonComponent = useMemo( @@ -37,10 +40,16 @@ const FullScreenButton = ({ view = {}, item }) => { active={false} disabled={false} iconName={usedIcon} + label={label} onMouseDown={e => handleMouseDown(e)} + title={ + !isEmpty(i18n) && i18n.exists(`Wax.Various.${titleToshow}`) + ? t(`Wax.Various.${titleToshow}`) + : titleToshow + } /> ), - [isActive, isDisabled, usedIcon], + [isActive, isDisabled, usedIcon, t(`Wax.Annotations.${title}`)], ); return MenuButtonComponent; diff --git a/wax-questions-service/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js b/wax-questions-service/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js index fddfcd316177624c54df76b93ceaa0a20f0da98d..e7005a3d1622f6e51d23b890b45901a3df4e68ef 100644 --- a/wax-questions-service/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js +++ b/wax-questions-service/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js @@ -66,7 +66,7 @@ const QuestionData = styled.div` flex-direction: row; .ProseMirror { :empty::before { - content: 'Type your answer'; + content: 'Type option'; color: #aaa; float: left; font-style: italic; @@ -238,7 +238,7 @@ export default ({ node, view, getPos }) => { <EditorComponent getPos={getPos} node={node} - placeholderText="Type your answer" + placeholderText="Type option" view={view} /> </QuestionData> diff --git a/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js b/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js index bb1944d7cb3c3b736129eb530c8c067a82300d16..8c7af5e73f80e0e6a62d8bf115e1ec5bf21f4f6a 100644 --- a/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js +++ b/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js @@ -66,7 +66,7 @@ const QuestionData = styled.div` flex-direction: row; .ProseMirror { :empty::before { - content: 'Type your answer'; + content: 'Type option'; color: #aaa; float: left; font-style: italic; @@ -238,7 +238,7 @@ export default ({ node, view, getPos }) => { <EditorComponent getPos={getPos} node={node} - placeholderText="Type your answer" + placeholderText="Type option" view={view} /> </QuestionData> diff --git a/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js b/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js index e478656ee6452ccbb37e412783f6a5eb698c48c4..818aca43e8ba603fd20c960fb1113a94b4941c9e 100644 --- a/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js +++ b/wax-questions-service/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js @@ -66,7 +66,7 @@ const QuestionData = styled.div` flex-direction: row; .ProseMirror { :empty::before { - content: 'Type your answer'; + content: 'Type option'; color: #aaa; float: left; font-style: italic; @@ -238,7 +238,7 @@ export default ({ node, view, getPos }) => { <EditorComponent getPos={getPos} node={node} - placeholderText="Type your answer" + placeholderText="Type option" view={view} /> </QuestionData> diff --git a/wax-questions-service/src/MultipleChoiceQuestionService/components/AnswerComponent.js b/wax-questions-service/src/MultipleChoiceQuestionService/components/AnswerComponent.js index c8c6fc818c9d2df17e3c4ac3a0d8274cdbcb32b8..b4325141b58fd6401285d1d48eeb1a6672c33d28 100644 --- a/wax-questions-service/src/MultipleChoiceQuestionService/components/AnswerComponent.js +++ b/wax-questions-service/src/MultipleChoiceQuestionService/components/AnswerComponent.js @@ -66,7 +66,7 @@ const QuestionData = styled.div` flex-direction: row; .ProseMirror { :empty::before { - content: 'Type your answer'; + content: 'Type option'; color: #aaa; float: left; font-style: italic; @@ -236,7 +236,7 @@ export default ({ node, view, getPos }) => { <EditorComponent getPos={getPos} node={node} - placeholderText="type your answer" + placeholderText="Type option" view={view} /> </QuestionData>