This commit is contained in:
hailin 2025-05-21 13:37:26 +08:00
parent e745855460
commit 289b086d71
2 changed files with 32 additions and 50 deletions

View File

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

View File

@ -1,18 +0,0 @@
import { Html, Head, Main, NextScript } from 'next/document';
import Script from 'next/script';
export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Script
src="/env.js"
strategy="beforeInteractive" // 确保在 React 启动之前加载
/>
<Main />
<NextScript />
</body>
</Html>
);
}