From bed9325371f2339116a05541500241acce8092eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20De=20Le=C3=B3n?= Date: Wed, 17 Jun 2026 08:53:16 -0600 Subject: [PATCH 1/2] refactor(layout): render Header and Footer once in [lang]/layout instead of per page --- src/app/[lang]/app/page.tsx | 2 -- src/app/[lang]/docs/layout.tsx | 8 ++------ src/app/[lang]/layout.tsx | 14 ++++++++++++++ src/app/[lang]/page.tsx | 16 +--------------- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/app/[lang]/app/page.tsx b/src/app/[lang]/app/page.tsx index be68492..ac4036b 100644 --- a/src/app/[lang]/app/page.tsx +++ b/src/app/[lang]/app/page.tsx @@ -2,7 +2,6 @@ import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { getDictionary } from "@/i18n/dictionaries"; import { isLocale } from "@/i18n/config"; -import Header from "@/components/layout/Header"; import CodeWorkspace from "@/components/ui/CodeWorkspace"; export const metadata: Metadata = { @@ -20,7 +19,6 @@ export default async function AppPage({ return ( <> -
-
-
+
{children}
-
- +
); } diff --git a/src/app/[lang]/layout.tsx b/src/app/[lang]/layout.tsx index f1fd3dc..3c23adf 100644 --- a/src/app/[lang]/layout.tsx +++ b/src/app/[lang]/layout.tsx @@ -2,6 +2,9 @@ import type { ReactNode } from "react"; import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { locales, isLocale, type Locale } from "@/i18n/config"; +import { getDictionary } from "@/i18n/dictionaries"; +import Header from "@/components/layout/Header"; +import Footer from "@/components/layout/Footer"; import "@fontsource-variable/lexend"; import "../globals.css"; @@ -23,12 +26,23 @@ export default async function RootLayout({ }) { const { lang } = await params; if (!isLocale(lang)) notFound(); + const t = getDictionary(lang); return (