Skip to content

Commit

Permalink
[Upd #193] Refactoring messages with new intl provider
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope committed Apr 23, 2024
1 parent 9d1f385 commit 9b6a716
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/components/Question.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<span onClick={this._toggleCollapse} title={title}>
Expand Down
3 changes: 0 additions & 3 deletions src/stories/Question.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ const optionsWithDebugModeOn = {
intl: {
locale: "en",
},
i18n: {},
debugMode: true,
};

const optionsWithStartingHiddenQuestion = {
intl: {
locale: "en",
},
i18n: {},
...getP("startingQuestionId", "hidden-question-1834"),
};

Expand All @@ -66,7 +64,6 @@ const Template: ComponentStory<typeof Question> = (
intl: {
locale: "en",
},
i18n: {},
debugMode: debugMode,
};
const _getComponentMappingFunction = () => {
Expand Down

0 comments on commit 9b6a716

Please sign in to comment.