Web-tier features completing the AtomCMS→Next.js conversion (slice 2): UI/UX: - Dark mode: html.dark CSS-var overrides + ThemeSwitcher (localStorage, no-flash boot script) wired into the nav. - i18n (next-intl, cookie-based / no URL routing): en + it catalogs, request.ts, provider in root layout, LanguageSwitcher; shell (nav, header, footer) fully translated. URLs + access-guard unchanged. - globals.css: --muted/--border aliases used across admin pages. User features: - /messages: offline messages + friend-request accept (server action re-reads session, two directional rows, idempotent). - Email verification: signed-token /verify route + sendVerification wired into register (best-effort, never blocks signup). - Article reactions: toggle UI on news/[slug] + server action. - Content moderation service (website_wordfilter + optional OpenAI moderations, fail-open) wired into article comments + guestbook. Admin CRUD parity (Filament replacement): - /admin/shop (+ new/[id]) packages CRUD + read-only orders. - /admin/transactions read-only PayPal log. - /admin/permissions, /admin/tags, /admin/ads (+ new/[id]), /admin/help-questions (+ new/[id]), /admin/radio/history, /admin/users/[id]/edit. All gated by requireStaff + logStaffActivity. Verified: tsc 0, vitest 48/48, next build 0 (all routes incl. new admin CRUD + /messages + /verify).
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { NextIntlClientProvider } from "next-intl";
|
|
import { getLocale, getMessages } from "next-intl/server";
|
|
import { Nunito } from "next/font/google";
|
|
import type { ReactNode } from "react";
|
|
import { Navigation } from "@/components/navigation";
|
|
import { SiteFooter } from "@/components/site-footer";
|
|
import { SiteHeader } from "@/components/site-header";
|
|
import { ThemeVars } from "@/components/theme-vars";
|
|
import { TopHeader } from "@/components/top-header";
|
|
import { enforceSiteAccess } from "@/lib/access-guard";
|
|
import "./globals.css";
|
|
|
|
const nunito = Nunito({
|
|
subsets: ["latin"],
|
|
weight: ["400", "600", "700", "800"],
|
|
display: "swap",
|
|
variable: "--font-nunito",
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "AtomCMS",
|
|
description: "AtomCMS — retro hotel CMS (Next.js conversion)",
|
|
};
|
|
|
|
export default async function RootLayout({ children }: { children: ReactNode }) {
|
|
await enforceSiteAccess();
|
|
const locale = await getLocale();
|
|
const messages = await getMessages();
|
|
return (
|
|
<html lang={locale} className={`app ${nunito.variable}`}>
|
|
<head>
|
|
{/* Apply the saved theme before first paint to avoid a light→dark flash. */}
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
__html:
|
|
"try{if(localStorage.getItem('theme')==='dark')document.documentElement.classList.add('dark');}catch(e){}",
|
|
}}
|
|
/>
|
|
</head>
|
|
<body
|
|
className="flex min-h-screen flex-col site-bg"
|
|
style={{ backgroundColor: "var(--color-background)" }}
|
|
>
|
|
<NextIntlClientProvider locale={locale} messages={messages}>
|
|
<ThemeVars />
|
|
<TopHeader />
|
|
<SiteHeader />
|
|
<Navigation />
|
|
<main className="overflow-hidden site-bg">
|
|
<div className="mx-auto mt-10 grid max-w-7xl grid-cols-12 gap-x-3 gap-y-8 p-6 md:mt-0">
|
|
<div className="col-span-12">{children}</div>
|
|
</div>
|
|
</main>
|
|
<SiteFooter />
|
|
</NextIntlClientProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|