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/Layouts/Layout.tsx | |
| parent | 47b854de26dea24e7838fd0804df103dee99635f (diff) | |
chore: replace lingui functions with react-intl
Diffstat (limited to 'src/components/Layouts/Layout.tsx')
| -rw-r--r-- | src/components/Layouts/Layout.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index 599cfe2..b479ef3 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -1,12 +1,12 @@ -import { ReactElement, ReactNode, useEffect, useRef } from 'react'; import Footer from '@components/Footer/Footer'; import Header from '@components/Header/Header'; import Main from '@components/Main/Main'; import Breadcrumb from '@components/Breadcrumb/Breadcrumb'; -import { t } from '@lingui/macro'; -import Head from 'next/head'; import { config } from '@config/website'; +import Head from 'next/head'; import { useRouter } from 'next/router'; +import { ReactElement, ReactNode, useEffect, useRef } from 'react'; +import { useIntl } from 'react-intl'; import { WebSite, WithContext } from 'schema-dts'; const Layout = ({ @@ -16,6 +16,7 @@ const Layout = ({ children: ReactNode; isHome?: boolean; }) => { + const intl = useIntl(); const ref = useRef<HTMLSpanElement>(null); const { asPath } = useRouter(); @@ -91,7 +92,12 @@ const Layout = ({ ></script> </Head> <span ref={ref} tabIndex={-1} /> - <a href="#main" className="screen-reader-text">{t`Skip to content`}</a> + <a href="#main" className="screen-reader-text"> + {intl.formatMessage({ + defaultMessage: 'Skip to content', + description: 'Layout: Skip to content button', + })} + </a> <Header isHome={isHome} /> <Main>{children}</Main> <Footer /> |
