From 8105e2577d4aa401f960e78085f6038eb879ee8a Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 24 Dec 2021 15:06:12 +0100 Subject: chore: replace legal notice page content with MDX content I cannot use WordPress shortcodes from a custom plugin through WP GraphQL so I'm using mdx file instead to define the page content. --- src/pages/mentions-legales.tsx | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/pages/mentions-legales.tsx') diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index 41e9a0c..6bb1a55 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -1,14 +1,13 @@ import { getLayout } from '@components/Layouts/Layout'; import ToC from '@components/ToC/ToC'; import { seo } from '@config/seo'; -import { getPageByUri } from '@services/graphql/queries'; import { NextPageWithLayout } from '@ts/types/app'; -import { PageProps } from '@ts/types/pages'; import { loadTranslation } from '@utils/helpers/i18n'; import { GetStaticProps, GetStaticPropsContext } from 'next'; import Head from 'next/head'; +import LegalNoticeContent, { meta } from '@content/pages/legal-notice.mdx'; -const LegalNotice: NextPageWithLayout = ({ page }) => { +const LegalNotice: NextPageWithLayout = () => { return ( <> @@ -17,17 +16,10 @@ const LegalNotice: NextPageWithLayout = ({ page }) => {
-

{page.title}

- {page.content && ( -
- )} +

{meta.title}

-
+
); @@ -42,13 +34,11 @@ export const getStaticProps: GetStaticProps = async ( context.locale!, process.env.NODE_ENV === 'production' ); - const page = await getPageByUri('/mentions-legales/'); - const breadcrumbTitle = page.title; + const breadcrumbTitle = meta.title; return { props: { breadcrumbTitle, - page, translation, }, }; -- cgit v1.2.3