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/404.tsx | 80 ++++++++------- src/pages/article/[slug].tsx | 216 ++++++++++++++------------------------- src/pages/blog/index.tsx | 102 ++++++++---------- src/pages/blog/page/[number].tsx | 105 ++++++++----------- src/pages/contact.tsx | 91 ++++++++--------- src/pages/cv.tsx | 160 ++++++++++++++--------------- src/pages/index.tsx | 3 +- src/pages/mentions-legales.tsx | 79 +++++++------- src/pages/projets/[slug].tsx | 112 ++++++++++---------- src/pages/projets/index.tsx | 28 +++-- src/pages/recherche/index.tsx | 102 ++++++++---------- src/pages/sujet/[slug].tsx | 153 +++++++++++---------------- src/pages/thematique/[slug].tsx | 141 +++++++++++-------------- 13 files changed, 591 insertions(+), 781 deletions(-) (limited to 'src/pages') diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 75e2205..d6785b6 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -2,6 +2,7 @@ import type { GetStaticProps } from 'next'; import Head from 'next/head'; import { useRouter } from 'next/router'; +import Script from 'next/script'; import { useCallback, type ReactNode } from 'react'; import { useIntl } from 'react-intl'; import { @@ -9,7 +10,10 @@ import { Heading, Link, LinksWidget, - PageLayout, + Page, + PageBody, + PageHeader, + PageSidebar, SearchForm, type SearchFormSubmit, } from '../components'; @@ -111,45 +115,20 @@ const Error404Page: NextPageWithLayout = ({ ); return ( - <> + {pageTitle} {/*eslint-disable-next-line react/jsx-no-literals -- Name allowed */} - - {thematicsListTitle} - - } - items={getLinksItemData( - thematicsList.map((thematic) => - getPageLinkFromRawData(thematic, 'thematic') - ) - )} - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="thematics-list" - />, - - {topicsListTitle} - - } - items={getLinksItemData( - topicsList.map((topic) => getPageLinkFromRawData(topic, 'topic')) - )} - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="topics-list" - />, - ]} - > +