Added shared layout with _app

This commit is contained in:
Luis Alvarez
2020-10-01 21:30:08 -05:00
parent 6587ab10ae
commit cf7c85e3ba
4 changed files with 21 additions and 15 deletions

View File

@@ -1,6 +1,15 @@
import { FC } from 'react'
import type { AppProps } from 'next/app'
import '@assets/global.css'
const Noop: FC = ({ children }) => <>{children}</>
export default function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
const Layout = (Component as any).Layout || Noop
return (
<Layout>
<Component {...pageProps} />
</Layout>
)
}