Decouple admin from public max-w-7xl via (site) route group.
Local Build and Deploy / deploy (push) Successful in 54s
Local Build and Deploy / deploy (push) Successful in 54s
Public chrome and width live only under (site). /admin and /client inherit the root layout alone, so housekeeping width is no longer tied to the public template. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
a1dc7ff0a7
commit
367f69a439
60 files changed
+29
-30
No files matched your search
+2
-30
@@ -1,17 +1,11 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Nunito, Pixelify_Sans } from "next/font/google";
|
||||
import { headers } from "next/headers";
|
||||
import Script from "next/script";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getLocale, getMessages } from "next-intl/server";
|
||||
import type { ReactNode } from "react";
|
||||
import { Navigation } from "@/components/navigation";
|
||||
import RadioPlayerGate from "@/components/public/radio-player-gate";
|
||||
import { PwaRegister } from "@/components/pwa-register";
|
||||
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 { siteSettings } from "@/lib/services/site-settings";
|
||||
import "./globals.css";
|
||||
@@ -63,16 +57,9 @@ export default async function RootLayout({
|
||||
await enforceSiteAccess();
|
||||
const locale = await getLocale();
|
||||
const messages = await getMessages();
|
||||
// "Dusk" / dark-by-default: the site starts dark unless the visitor has picked
|
||||
// light. The saved choice always wins over the default.
|
||||
const defaultDark = await siteSettings.getBool("default_dark", false);
|
||||
|
||||
const headersList = await headers();
|
||||
const pathname =
|
||||
headersList.get("x-pathname") || headersList.get("next-url") || "";
|
||||
const isClient = pathname === "/client" || pathname.startsWith("/client/");
|
||||
const isAdmin = pathname === "/admin" || pathname.startsWith("/admin/");
|
||||
const nitroUrl = await siteSettings.get("nitro_client_url", "");
|
||||
|
||||
return (
|
||||
<html
|
||||
lang={locale}
|
||||
@@ -93,22 +80,7 @@ export default async function RootLayout({
|
||||
>
|
||||
<NextIntlClientProvider locale={locale} messages={messages}>
|
||||
<ThemeVars />
|
||||
{isClient || isAdmin ? (
|
||||
children
|
||||
) : (
|
||||
<>
|
||||
<TopHeader />
|
||||
<SiteHeader />
|
||||
<Navigation />
|
||||
<main>
|
||||
<div className="mx-auto mt-6 grid max-w-7xl grid-cols-12 gap-x-3 gap-y-6 px-4 py-4 md:mt-0 md:p-6">
|
||||
<div className="col-span-12 min-w-0">{children}</div>
|
||||
</div>
|
||||
</main>
|
||||
<SiteFooter />
|
||||
<RadioPlayerGate />
|
||||
</>
|
||||
)}
|
||||
{children}
|
||||
<PwaRegister />
|
||||
</NextIntlClientProvider>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user