mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
move Layout into _app.tsx
This commit is contained in:
committed by
Thomas Ruoff
parent
7389289b81
commit
2fd3a47e72
@@ -1,7 +1,11 @@
|
||||
export { reportWebVitals } from 'next-axiom'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import { useSession, signIn, SessionProvider } from 'next-auth/react'
|
||||
import Layout from '../components/layout';
|
||||
|
||||
import '../styles/index.css'
|
||||
|
||||
function Auth({ children }) {
|
||||
@@ -29,13 +33,15 @@ export default function MyApp({
|
||||
return (
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<SessionProvider session={session}>
|
||||
{Component.authenticationRequired ? (
|
||||
<Auth>
|
||||
<Layout>
|
||||
{Component.authenticationRequired ? (
|
||||
<Auth>
|
||||
<Component {...pageProps} />
|
||||
</Auth>
|
||||
) : (
|
||||
<Component {...pageProps} />
|
||||
</Auth>
|
||||
) : (
|
||||
<Component {...pageProps} />
|
||||
)}
|
||||
)}
|
||||
</Layout>
|
||||
</SessionProvider>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user