This commit is contained in:
parent
b3c8a40c2a
commit
672e59b1d7
|
|
@ -20,7 +20,7 @@ import { ReactNode } from 'react';
|
||||||
import TranslationsProvider from '@/components/TranslationsProvider';
|
import TranslationsProvider from '@/components/TranslationsProvider';
|
||||||
import initTranslations from '../i18n';
|
import initTranslations from '../i18n';
|
||||||
|
|
||||||
//import { usePathname } from 'next/navigation'; // Next.js 13+ 内置钩子
|
import { usePathname } from 'next/navigation';
|
||||||
|
|
||||||
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
|
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
|
||||||
|
|
||||||
|
|
@ -73,10 +73,10 @@ export default async function RootLayout({
|
||||||
|
|
||||||
const { t, resources } = await initTranslations(locale, i18nNamespaces);
|
const { t, resources } = await initTranslations(locale, i18nNamespaces);
|
||||||
|
|
||||||
//const pathname = usePathname(); // 获取当前页面路径
|
const pathname = usePathname(); // 获取当前页面路径
|
||||||
|
|
||||||
// 如果路径是某些特定页面(例如 /auth),则不渲染 Header
|
// 如果路径是某些特定页面(例如 /auth),则不渲染 Header
|
||||||
//const showHeader = !pathname.startsWith('/auth');
|
const showHeader = !pathname.startsWith('/auth');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang={locale} dir={dir(locale)} suppressHydrationWarning>
|
<html lang={locale} dir={dir(locale)} suppressHydrationWarning>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue