diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-12-09 18:13:46 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-12-09 18:18:34 +0100 |
| commit | cd2cb5748be9e9c479d9802dd3897de1cd1cbd9f (patch) | |
| tree | 29d0022f7beb1d365354079479f653cd4ff70ba9 /src/pages/mentions-legales.tsx | |
| parent | 2cc983064467fdef5630eeabc1a87d454afdb58d (diff) | |
refactor(pages): refine LegalNotice page
* remove unnecessary dependency (useRouter)
* fix React errors (blurWidth/blurHeight)
* complete Cypress tests
Diffstat (limited to 'src/pages/mentions-legales.tsx')
| -rw-r--r-- | src/pages/mentions-legales.tsx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index 7d46680..176c8fe 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -1,7 +1,5 @@ -/* eslint-disable max-statements */ import type { GetStaticProps } from 'next'; import Head from 'next/head'; -import { useRouter } from 'next/router'; import Script from 'next/script'; import { useIntl } from 'react-intl'; import { @@ -36,13 +34,12 @@ const LegalNoticePage: NextPageWithLayout = () => { title, url: ROUTES.LEGAL_NOTICE, }); - const { ref, tree } = useHeadingsTree<HTMLDivElement>({ fromLevel: 2 }); - const { asPath } = useRouter(); + const webpageSchema = getWebPageSchema({ description: seo.description, locale: CONFIG.locales.defaultLocale, - slug: asPath, + slug: ROUTES.LEGAL_NOTICE, title: seo.title, updateDate: dates.update, }); @@ -52,13 +49,14 @@ const LegalNoticePage: NextPageWithLayout = () => { id: 'legal-notice', kind: 'page', locale: CONFIG.locales.defaultLocale, - slug: asPath, + slug: ROUTES.LEGAL_NOTICE, title, }); const schemaJsonLd = getSchemaJson([webpageSchema, articleSchema]); + const page = { title: `${seo.title} - ${CONFIG.name}`, - url: `${CONFIG.url}${asPath}`, + url: `${CONFIG.url}${ROUTES.LEGAL_NOTICE}`, }; const tocTitle = intl.formatMessage({ defaultMessage: 'Table of Contents', @@ -100,7 +98,7 @@ const LegalNoticePage: NextPageWithLayout = () => { /> <PageSidebar> <TocWidget - heading={<Heading level={3}>{tocTitle}</Heading>} + heading={<Heading level={2}>{tocTitle}</Heading>} tree={tree} /> </PageSidebar> |
