From 70b4f633a6fbedb58c8b9134ac64ede854d489de Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 12:27:46 +0100 Subject: refactor(components): replace PageLayout template with Page * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome` --- src/pages/contact.tsx | 91 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 46 deletions(-) (limited to 'src/pages/contact.tsx') diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index f316143..b10d161 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -8,10 +8,13 @@ import { useIntl } from 'react-intl'; import { ContactForm, getLayout, - PageLayout, SocialMediaWidget, Heading, type ContactFormSubmit, + Page, + PageHeader, + PageBody, + PageSidebar, } from '../components'; import { meta } from '../content/pages/contact.mdx'; import { sendMail } from '../services/graphql'; @@ -78,39 +81,6 @@ const ContactPage: NextPageWithLayout = () => { description: 'ContactPage: LinkedIn profile link', id: 'Q3oEQn', }); - - const widgets = [ - - {socialMediaTitle} - - } - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="social-media" - media={[ - { - icon: 'Github', - id: 'github', - label: githubLabel, - url: 'https://github.com/ArmandPhilippot', - }, - { - icon: 'Gitlab', - id: 'gitlab', - label: gitlabLabel, - url: 'https://gitlab.com/ArmandPhilippot', - }, - { - icon: 'LinkedIn', - id: 'linkedin', - label: linkedinLabel, - url: 'https://www.linkedin.com/in/armandphilippot', - }, - ]} - />, - ]; - const formName = intl.formatMessage({ defaultMessage: 'Contact form', description: 'Contact: form accessible name', @@ -163,7 +133,7 @@ const ContactPage: NextPageWithLayout = () => { }; return ( - <> + {page.title} {/*eslint-disable-next-line react/jsx-no-literals -- Name allowed */} @@ -180,21 +150,50 @@ const ContactPage: NextPageWithLayout = () => { type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} /> - +