Files
Epicure/apps/web/app/layout.tsx
T
Arnaud 212d6f7335 fix: browser tab title should always just say "Epicure"
Root layout used title.template ("%s | Epicure") and 38 pages set
their own title, producing "Recipes | Epicure", "Messages — Epicure",
etc. Drop the template, set a flat "Epicure" default, and clear every
page's title override so they all inherit it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 14:58:03 +02:00

50 lines
1.4 KiB
TypeScript

import type { Metadata, Viewport } from "next";
import { Lora, Geist_Mono } from "next/font/google";
import { headers } from "next/headers";
import { Providers } from "@/components/providers";
import { auth } from "@/lib/auth/server";
import type { Locale } from "@/lib/i18n/provider";
import { SwRegister } from "@/components/pwa/sw-register";
import "./globals.css";
const lora = Lora({
variable: "--font-lora",
subsets: ["latin"],
display: "swap",
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Epicure",
description: "Your personal AI-powered recipe book.",
manifest: "/manifest.json",
};
export const viewport: Viewport = {
themeColor: "#18181b",
};
export default async function RootLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
const session = await auth.api.getSession({ headers: await headers() }).catch(() => null);
const initialLocale = ((session?.user as { locale?: string })?.locale ?? "en") as Locale;
return (
<html
lang={initialLocale}
suppressHydrationWarning
className={`${lora.variable} ${geistMono.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col">
<Providers initialLocale={initialLocale}>{children}</Providers>
<SwRegister />
</body>
</html>
);
}