From b95fa02922f5d6de77eb0e813c8ffcf676c58228 Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Sun, 1 Jun 2025 17:24:44 +0330 Subject: [PATCH] refactor(layout): improve locale handling by storing cookie in a variable fix(page): comment out ChangeLangButton component --- src/app/layout.tsx | 3 ++- src/app/page.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f0a1bf9..e89f824 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -12,7 +12,8 @@ export default async function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { - const locale = (await cookies()).get('lang')?.value || 'en'; + const cookieStore = await cookies(); + const locale = cookieStore.get('lang')?.value || 'en'; return ( diff --git a/src/app/page.tsx b/src/app/page.tsx index 20d667f..77a6fad 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -19,7 +19,7 @@ export default async function Home() {
{t('pages_home_title') as string} - + {/* */}
); }