diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-29 18:21:37 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-29 19:02:57 +0100 |
| commit | e4d5b8151802517b2943756fc0d09ffa95e2c4e2 (patch) | |
| tree | 9e99137a7b64ea7993a8311a7162336a551be8b2 /src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx | |
| parent | 47b854de26dea24e7838fd0804df103dee99635f (diff) | |
chore: replace lingui functions with react-intl
Diffstat (limited to 'src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx')
| -rw-r--r-- | src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx b/src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx index 52b5c06..6a19d92 100644 --- a/src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx +++ b/src/components/WidgetParts/ExpandableWidget/ExpandableWidget.tsx @@ -1,6 +1,6 @@ -import { t } from '@lingui/macro'; import { TitleLevel } from '@ts/types/app'; import { ReactNode, useState } from 'react'; +import { useIntl } from 'react-intl'; import styles from './ExpandableWidget.module.scss'; const ExpandableWidget = ({ @@ -16,6 +16,7 @@ const ExpandableWidget = ({ expand?: boolean; withBorders?: boolean; }) => { + const intl = useIntl(); const [isExpanded, setIsExpanded] = useState<boolean>(expand); const handleExpanse = () => setIsExpanded((prev) => !prev); @@ -34,7 +35,15 @@ const ExpandableWidget = ({ <div className={wrapperClasses}> <button type="button" className={styles.header} onClick={handleExpanse}> <span className="screen-reader-text"> - {isExpanded ? t`Collapse` : t`Expand`} + {isExpanded + ? intl.formatMessage({ + defaultMessage: 'Collapse', + description: 'ExpandableWidget: collapse text', + }) + : intl.formatMessage({ + defaultMessage: 'Expand', + description: 'ExpandableWidget: expand text', + })} </span> <TitleTag className={styles.title}>{title}</TitleTag> <span className={styles.icon} aria-hidden={true}></span> |
