diff --git a/src/components/Question.jsx b/src/components/Question.jsx index acfff3fe..4f121fcf 100644 --- a/src/components/Question.jsx +++ b/src/components/Question.jsx @@ -442,12 +442,9 @@ export default class Question extends React.Component { } _renderCollapseToggle() { - const { options } = this.context; - - // TODO: Convert this component into a functional component to use useIntl() Hook const title = this.state.expanded - ? options.i18n["section.collapse"] - : options.i18n["section.expand"]; + ? this.props.intl.formatMessage({ id: "section.collapse" }) + : this.props.intl.formatMessage({ id: "section.expand" }); return ( diff --git a/src/stories/Question.stories.tsx b/src/stories/Question.stories.tsx index 185f30c5..f509b952 100644 --- a/src/stories/Question.stories.tsx +++ b/src/stories/Question.stories.tsx @@ -37,7 +37,6 @@ const optionsWithDebugModeOn = { intl: { locale: "en", }, - i18n: {}, debugMode: true, }; @@ -45,7 +44,6 @@ const optionsWithStartingHiddenQuestion = { intl: { locale: "en", }, - i18n: {}, ...getP("startingQuestionId", "hidden-question-1834"), }; @@ -66,7 +64,6 @@ const Template: ComponentStory = ( intl: { locale: "en", }, - i18n: {}, debugMode: debugMode, }; const _getComponentMappingFunction = () => {