From e4d5b8151802517b2943756fc0d09ffa95e2c4e2 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Sat, 29 Jan 2022 18:21:37 +0100
Subject: chore: replace lingui functions with react-intl

---
 src/components/SearchForm/SearchForm.tsx | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

(limited to 'src/components/SearchForm/SearchForm.tsx')

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>
     </>
-- 
cgit v1.2.3

