refactor(layout): improve locale handling by storing cookie in a variable
fix(page): comment out ChangeLangButton component
This commit is contained in:
+2
-1
@@ -12,7 +12,8 @@ export default async function RootLayout({
|
|||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
const locale = (await cookies()).get('lang')?.value || 'en';
|
const cookieStore = await cookies();
|
||||||
|
const locale = cookieStore.get('lang')?.value || 'en';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang={locale} dir={locale === 'fa' ? 'rtl' : 'ltr'}>
|
<html lang={locale} dir={locale === 'fa' ? 'rtl' : 'ltr'}>
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ export default async function Home() {
|
|||||||
<main className="flex min-h-screen flex-col items-center justify-between p-24 text-gray-300">
|
<main className="flex min-h-screen flex-col items-center justify-between p-24 text-gray-300">
|
||||||
<span>{t('pages_home_title') as string}</span>
|
<span>{t('pages_home_title') as string}</span>
|
||||||
|
|
||||||
<ChangeLangButton />
|
{/* <ChangeLangButton /> */}
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user