summaryrefslogtreecommitdiffstats
path: root/src/components/SearchForm
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-29 18:21:37 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-29 19:02:57 +0100
commite4d5b8151802517b2943756fc0d09ffa95e2c4e2 (patch)
tree9e99137a7b64ea7993a8311a7162336a551be8b2 /src/components/SearchForm
parent47b854de26dea24e7838fd0804df103dee99635f (diff)
chore: replace lingui functions with react-intl
Diffstat (limited to 'src/components/SearchForm')
-rw-r--r--src/components/SearchForm/SearchForm.tsx17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/components/SearchForm/SearchForm.tsx b/src/components/SearchForm/SearchForm.tsx
index cefda85..38ae60d 100644
--- a/src/components/SearchForm/SearchForm.tsx
+++ b/src/components/SearchForm/SearchForm.tsx
@@ -1,12 +1,13 @@
import { ButtonSubmit } from '@components/Buttons';
import { Form, Input } from '@components/Form';
import { SearchIcon } from '@components/Icons';
-import { t } from '@lingui/macro';
import { useRouter } from 'next/router';
import { FormEvent, useEffect, useRef, useState } from 'react';
+import { useIntl } from 'react-intl';
import styles from './SearchForm.module.scss';
const SearchForm = ({ isOpened }: { isOpened: boolean }) => {
+ const intl = useIntl();
const [query, setQuery] = useState('');
const inputRef = useRef<HTMLInputElement>(null);
const router = useRouter();
@@ -27,7 +28,12 @@ const SearchForm = ({ isOpened }: { isOpened: boolean }) => {
return (
<>
- <div className={styles.title}>{t`Search`}</div>
+ <div className={styles.title}>
+ {intl.formatMessage({
+ defaultMessage: 'Search',
+ description: 'SearchForm : form title',
+ })}
+ </div>
<Form submitHandler={launchSearch} modifier="search">
<Input
ref={inputRef}
@@ -39,7 +45,12 @@ const SearchForm = ({ isOpened }: { isOpened: boolean }) => {
/>
<ButtonSubmit modifier="search">
<SearchIcon />
- <span className="screen-reader-text">{t`Search`}</span>
+ <span className="screen-reader-text">
+ {intl.formatMessage({
+ defaultMessage: 'Search',
+ description: 'SearchForm: search button text',
+ })}
+ </span>
</ButtonSubmit>
</Form>
</>