This commit is contained in:
hailin 2025-05-21 14:36:58 +08:00
parent 61f2a8f8fb
commit 48ce4a9fa9
2 changed files with 47 additions and 32 deletions

View File

@ -122,38 +122,38 @@ export default async function RootLayout({
//console.log("[layout.tsx]..............current locale: ", {locale}); //console.log("[layout.tsx]..............current locale: ", {locale});
return ( // return (
<html lang="en" suppressHydrationWarning> // <html lang="en" suppressHydrationWarning>
<body className={inter.className}> // <body className={inter.className}>
<Providers attribute="class" defaultTheme="dark"> // <Providers attribute="class" defaultTheme="dark">
<TranslationsProvider // <TranslationsProvider
namespaces={i18nNamespaces} // namespaces={i18nNamespaces}
locale={locale} // locale={locale}
resources={resources} // resources={resources}
> // >
<Toaster richColors position="top-center" duration={3000} /> // <Toaster richColors position="top-center" duration={3000} />
<div className="bg-background text-foreground flex h-dvh flex-col items-center overflow-x-auto"> // <div className="bg-background text-foreground flex h-dvh flex-col items-center overflow-x-auto">
{data.session ? <GlobalState>{children}</GlobalState> : children} // {data.session ? <GlobalState>{children}</GlobalState> : children}
</div> // </div>
</TranslationsProvider> // </TranslationsProvider>
</Providers> // </Providers>
</body> // </body>
</html> // </html>
) // )
// return ( return (
// <Providers attribute="class" defaultTheme="dark"> <Providers attribute="class" defaultTheme="dark">
// <TranslationsProvider <TranslationsProvider
// namespaces={i18nNamespaces} namespaces={i18nNamespaces}
// locale={locale} locale={locale}
// resources={resources} resources={resources}
// > >
// <Toaster richColors position="top-center" duration={3000} /> <Toaster richColors position="top-center" duration={3000} />
// <div className={`${inter.className} bg-background text-foreground flex h-dvh flex-col items-center overflow-x-auto`}> <div className={`${inter.className} bg-background text-foreground flex h-dvh flex-col items-center overflow-x-auto`}>
// {data.session ? <GlobalState>{children}</GlobalState> : children} {data.session ? <GlobalState>{children}</GlobalState> : children}
// </div> </div>
// </TranslationsProvider> </TranslationsProvider>
// </Providers> </Providers>
// ) )
} }

View File

@ -0,0 +1,15 @@
// _document.tsx
import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}