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/ts/types/app.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/ts') diff --git a/src/ts/types/app.ts b/src/ts/types/app.ts index a3b9889..feff5a5 100644 --- a/src/ts/types/app.ts +++ b/src/ts/types/app.ts @@ -1,3 +1,24 @@ +import { NextPage } from 'next'; +import { AppProps } from 'next/app'; +import { ReactElement, ReactNode } from 'react'; + +export type NextPageWithLayoutOptions = { + withExtraPadding?: boolean; + isHome?: boolean; + useGrid?: boolean; +}; + +export type NextPageWithLayout = NextPage & { + getLayout?: ( + page: ReactElement, + options: NextPageWithLayoutOptions + ) => ReactNode; +}; + +export type AppPropsWithLayout = AppProps & { + Component: NextPageWithLayout; +}; + export type ContentKind = | 'article' | 'comment' -- cgit v1.2.3