From 4698d67c3806ac184b4b30ed29dd7afb2eb2554f Mon Sep 17 00:00:00 2001 From: Indigo Tang Date: Mon, 9 Jun 2025 03:26:05 +0000 Subject: [PATCH] I see this error with the app, reported by NextJS, please fix it. The er --- src/app/[locale]/layout.tsx | 66 +++++++++++++------------------------ src/app/layout.tsx | 25 +++----------- 2 files changed, 28 insertions(+), 63 deletions(-) diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 9445d76..1733371 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -1,6 +1,6 @@ -import type { Metadata } from 'next'; -import { PT_Sans } from 'next/font/google'; -import '../globals.css'; // Adjusted path for globals.css +// This layout wraps specific locale pages and sets up providers. +import type { Metadata } from 'next'; // Keep for potential locale-specific metadata +import '../globals.css'; // Ensure global styles are still imported import { Toaster } from "@/components/ui/toaster"; import Header from '@/components/layout/Header'; import Footer from '@/components/layout/Footer'; @@ -9,26 +9,16 @@ import { ThemeProvider } from '@/components/theme-provider'; import { I18nProviderClient } from '@/locales/client'; import { getStaticParams } from '@/locales/server'; -const ptSans = PT_Sans({ - subsets: ['latin'], - weight: ['400', '700'], - variable: '--font-body', -}); +// PT_Sans is applied globally from src/app/layout.tsx via ptSans.variable on body -export const metadata: Metadata = { - title: 'ToyShare - Share and Rent Toys', - description: 'A friendly platform to share and rent toys in your community.', - icons: { - icon: '/favicon.ico', - } -}; - -// Needed for static generation with dynamic [locale] segment export function generateStaticParams() { return getStaticParams(); } -export default function RootLayout({ +// Potentially add locale-specific metadata here if needed, or it can merge with root. +// export const metadata: Metadata = { ... }; + +export default async function LocaleLayout({ children, params: { locale } }: Readonly<{ @@ -37,31 +27,21 @@ export default function RootLayout({ }>) { return ( - - - - - - - - -
-
- {children} -
-