summaryrefslogtreecommitdiffstats
path: root/src/pages/_app.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-13 12:06:06 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-13 12:06:06 +0100
commit4cae14b9f86609b8c1f74d97a033e7091af49cb4 (patch)
treef5e81bde47b47947901a00307a47c36e3fc38ffd /src/pages/_app.tsx
parent45335042c91c6bf5aa736658c461d54f96a6e0f2 (diff)
chore: change app to use a layout
I can now insert header/footer on each pages.
Diffstat (limited to 'src/pages/_app.tsx')
-rw-r--r--src/pages/_app.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 6f08a02..8194b10 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,8 +1,9 @@
+import { AppPropsWithLayout } from '@ts/types/app';
import '../styles/globals.scss';
-import type { AppProps } from 'next/app';
-function MyApp({ Component, pageProps }: AppProps) {
- return <Component {...pageProps} />;
+function MyApp({ Component, pageProps }: AppPropsWithLayout) {
+ const getLayout = Component.getLayout ?? ((page) => page);
+ return getLayout(<Component {...pageProps} />);
}
export default MyApp;