Removes every other screen, API route, component, test and the dependencies only they used. Cookie colite_admin, Co-Lite branding, BO_USERS/BO_ROLES modules only. The user form no longer loads branches, events or country scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
62 lines
2.4 KiB
TypeScript
62 lines
2.4 KiB
TypeScript
import type { Metadata } from "next";
|
|
import localFont from "next/font/local";
|
|
import "./globals.css";
|
|
import { AdminAuthProvider } from "@/app/lib/AdminAuthContext";
|
|
import { ThemeProvider } from "@/app/lib/theme";
|
|
import { MessagesProvider } from "@/app/lib/i18n/MessagesProvider";
|
|
import { LocalesProvider } from "@/app/lib/i18n/LocalesProvider";
|
|
import { requestCatalog, requestLocale, getServerT } from "@/app/lib/server/i18n";
|
|
import AppShell from "@/app/components/app/AppShell";
|
|
|
|
// Self-hosted: the CI Docker build has no network access to Google Fonts
|
|
// (next/font/google fetches at build time).
|
|
const inter = localFont({
|
|
src: "./fonts/inter-latin-wght-normal.woff2",
|
|
weight: "100 900",
|
|
variable: "--font-inter",
|
|
display: "swap",
|
|
});
|
|
const dmSans = localFont({
|
|
src: "./fonts/dm-sans-latin-wght-normal.woff2",
|
|
weight: "100 1000",
|
|
variable: "--font-dm-sans",
|
|
display: "swap",
|
|
});
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const t = await getServerT();
|
|
return {
|
|
title: t("BackOfficeMetaTitle"),
|
|
description: t("LayoutMetaDescription"),
|
|
};
|
|
}
|
|
|
|
// Locale resolution mirrors solvway-customer-portal's app/layout.tsx: the
|
|
// bb_locale cookie wins when present (set client-side by LocaleSwitcher),
|
|
// else Accept-Language resolved against the RUNTIME registry codes, else
|
|
// DEFAULT_LOCALE. The catalog is loaded server-side (version-aware cache, see
|
|
// lib/server/messages.ts) and handed to every descendant through
|
|
// MessagesProvider; the runtime locale list (lib/server/locales.ts ->
|
|
// /api/admin/locales, FALLBACK_LOCALES on failure) goes through
|
|
// LocalesProvider for the switcher and the /messages per-locale inputs.
|
|
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
|
// Resolution lives in lib/server/i18n.ts so getServerT (server components) can never disagree with it.
|
|
const [{ locale, locales }, messages] = await Promise.all([requestLocale(), requestCatalog()]);
|
|
|
|
return (
|
|
<html lang={locale.replace("_", "-")} className={`${inter.variable} ${dmSans.variable}`}>
|
|
<body className="antialiased">
|
|
<LocalesProvider locales={locales}>
|
|
<MessagesProvider locale={locale} messages={messages}>
|
|
<ThemeProvider>
|
|
<AdminAuthProvider>
|
|
<AppShell>{children}</AppShell>
|
|
</AdminAuthProvider>
|
|
</ThemeProvider>
|
|
</MessagesProvider>
|
|
</LocalesProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|