diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-24 15:06:12 +0100 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-24 15:09:38 +0100 | 
| commit | 8105e2577d4aa401f960e78085f6038eb879ee8a (patch) | |
| tree | 22ce815ad854b80133d63f57e5ac4f07d629e943 /src/pages | |
| parent | a35f1a9c2564557aea9bca4abb8db5f820a7ad79 (diff) | |
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.
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/mentions-legales.tsx | 20 | 
1 files changed, 5 insertions, 15 deletions
| 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<PageProps> = ({ page }) => { +const LegalNotice: NextPageWithLayout = () => {    return (      <>        <Head> @@ -17,17 +16,10 @@ const LegalNotice: NextPageWithLayout<PageProps> = ({ page }) => {        </Head>        <article>          <header> -          <h1>{page.title}</h1> -          {page.content && ( -            <div dangerouslySetInnerHTML={{ __html: page.intro }}></div> -          )} +          <h1>{meta.title}</h1>          </header>          <ToC /> -        <div -          dangerouslySetInnerHTML={{ -            __html: page.content ? page.content : page.intro, -          }} -        ></div> +        <LegalNoticeContent />        </article>      </>    ); @@ -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,      },    }; | 
