65 lines
2.0 KiB
TypeScript
65 lines
2.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Plus_Jakarta_Sans, JetBrains_Mono } from "next/font/google";
|
|
import { NextIntlClientProvider } from 'next-intl';
|
|
import { getMessages, setRequestLocale } from 'next-intl/server';
|
|
import { notFound } from 'next/navigation';
|
|
import { routing } from '@/i18n/routing';
|
|
import { Navbar } from '@/components/Navbar';
|
|
import { Footer } from '@/components/Footer';
|
|
import "../globals.css";
|
|
|
|
const jakartaSans = Plus_Jakarta_Sans({
|
|
variable: "--font-sans",
|
|
subsets: ["latin"],
|
|
weight: ["300", "400", "500", "600", "700", "800"],
|
|
});
|
|
|
|
const jetbrainsMono = JetBrains_Mono({
|
|
variable: "--font-mono",
|
|
subsets: ["latin"],
|
|
weight: ["400", "500", "600", "700"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "DevHub YouTube | Educational Code & Resource Portal",
|
|
description: "Official resource portal featuring tabbed code snippets, lesson notes, starter packs, and project downloads for my YouTube tutorials.",
|
|
};
|
|
|
|
export function generateStaticParams() {
|
|
return routing.locales.map((locale) => ({ locale }));
|
|
}
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
params
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
params: Promise<{ locale: string }>;
|
|
}>) {
|
|
const { locale } = await params;
|
|
|
|
if (!routing.locales.includes(locale as any)) {
|
|
notFound();
|
|
}
|
|
|
|
setRequestLocale(locale);
|
|
const messages = await getMessages();
|
|
|
|
return (
|
|
<html
|
|
lang={locale}
|
|
className={`${jakartaSans.variable} ${jetbrainsMono.variable} dark h-full antialiased`}
|
|
>
|
|
<body className="min-h-full flex flex-col bg-slate-950 text-slate-100 font-sans selection:bg-red-500 selection:text-white tracking-normal leading-relaxed" suppressHydrationWarning>
|
|
<NextIntlClientProvider messages={messages}>
|
|
<Navbar locale={locale} />
|
|
<main className="flex-1 flex flex-col">
|
|
{children}
|
|
</main>
|
|
<Footer locale={locale} />
|
|
</NextIntlClientProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|