From 271ef6debaca7ed9a01829dcef3a37e90a2dff05 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 17 May 2022 22:48:41 +0200 Subject: chore: use persistent layout It prevents to rerender the common components between pages (header, footer...). --- src/pages/404.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/pages/404.tsx') diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 4f6e22d..4ab7784 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,11 +1,13 @@ import Link from '@components/atoms/links/link'; import LinksListWidget from '@components/organisms/widgets/links-list-widget'; +import { getLayout } from '@components/templates/layout/layout'; import PageLayout from '@components/templates/page/page-layout'; import { getThematicsPreview, getTotalThematics, } from '@services/graphql/thematics'; import { getTopicsPreview, getTotalTopics } from '@services/graphql/topics'; +import { type NextPageWithLayout } from '@ts/types/app'; import { type RawThematicPreview, type RawTopicPreview, @@ -17,7 +19,7 @@ import { } from '@utils/helpers/pages'; import useBreadcrumb from '@utils/hooks/use-breadcrumb'; import useSettings from '@utils/hooks/use-settings'; -import { GetStaticProps, NextPage } from 'next'; +import { GetStaticProps } from 'next'; import Head from 'next/head'; import { ReactNode } from 'react'; import { useIntl } from 'react-intl'; @@ -31,7 +33,7 @@ type Error404PageProps = { /** * Error 404 page. */ -const Error404Page: NextPage = ({ +const Error404Page: NextPageWithLayout = ({ thematicsList, topicsList, }) => { @@ -119,6 +121,9 @@ const Error404Page: NextPage = ({ ); }; +Error404Page.getLayout = (page) => + getLayout(page, { useGrid: true, withExtraPadding: true }); + export const getStaticProps: GetStaticProps = async ({ locale, }) => { -- cgit v1.2.3