mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Added shared layout with _app
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user