Skip to content

Commit 9ccf851

Browse files
Fix async cookies usage
1 parent f886004 commit 9ccf851

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/app/503/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export const metadata: Metadata = {
1212
},
1313
};
1414

15-
export default function ServiceUnavailable() {
16-
const cookieStore = cookies();
15+
export default async function ServiceUnavailable() {
16+
const cookieStore = await cookies();
1717
const language = cookieStore.get("lang")?.value === "en" ? "en" : "tr";
1818
const t = copy[language].errors.service;
1919

src/app/about/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const metadata: Metadata = {
99
"About Yamac, an Electrical & Electronics student building full-stack projects.",
1010
};
1111

12-
export default function AboutPage() {
13-
const cookieStore = cookies();
12+
export default async function AboutPage() {
13+
const cookieStore = await cookies();
1414
const language = cookieStore.get("lang")?.value === "en" ? "en" : "tr";
1515
const t = copy[language].pages.about;
1616

src/app/contact/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const metadata: Metadata = {
99
description: "Contact Yamac for projects and collaborations.",
1010
};
1111

12-
export default function ContactPage() {
13-
const cookieStore = cookies();
12+
export default async function ContactPage() {
13+
const cookieStore = await cookies();
1414
const language = cookieStore.get("lang")?.value === "en" ? "en" : "tr";
1515
const t = copy[language].pages.contact;
1616

src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ export const metadata: Metadata = {
6363
],
6464
};
6565

66-
export default function RootLayout({
66+
export default async function RootLayout({
6767
children,
6868
}: Readonly<{
6969
children: React.ReactNode;
7070
}>) {
71-
const cookieStore = cookies();
71+
const cookieStore = await cookies();
7272
const theme = cookieStore.get("theme")?.value === "light" ? "light" : "dark";
7373
const langValue = cookieStore.get("lang")?.value;
7474
const language: Language = langValue === "en" ? "en" : "tr";

src/app/not-found.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export const metadata: Metadata = {
1212
},
1313
};
1414

15-
export default function NotFound() {
16-
const cookieStore = cookies();
15+
export default async function NotFound() {
16+
const cookieStore = await cookies();
1717
const language = cookieStore.get("lang")?.value === "en" ? "en" : "tr";
1818
const t = copy[language].errors.notFound;
1919

src/app/projects/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const metadata: Metadata = {
1111
};
1212

1313
export default async function ProjectsPage() {
14-
const cookieStore = cookies();
14+
const cookieStore = await cookies();
1515
const language = cookieStore.get("lang")?.value === "en" ? "en" : "tr";
1616
const t = copy[language].pages.projects;
1717
const projects = await getGithubProjects();

0 commit comments

Comments
 (0)