summaryrefslogtreecommitdiffstats
path: root/src/ts
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-17 22:48:41 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-17 22:48:41 +0200
commit271ef6debaca7ed9a01829dcef3a37e90a2dff05 (patch)
treeaa1513b40e7020a44cfcaaedc3a33d39ecfb8af7 /src/ts
parent4e53a8654441481029746ff4e35a4a19c8d83709 (diff)
chore: use persistent layout
It prevents to rerender the common components between pages (header, footer...).
Diffstat (limited to 'src/ts')
-rw-r--r--src/ts/types/app.ts21
1 files changed, 21 insertions, 0 deletions
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<T = {}> = NextPage<T> & {
+ getLayout?: (
+ page: ReactElement,
+ options: NextPageWithLayoutOptions
+ ) => ReactNode;
+};
+
+export type AppPropsWithLayout = AppProps & {
+ Component: NextPageWithLayout;
+};
+
export type ContentKind =
| 'article'
| 'comment'