From 4b25292ecc61ece0b6b0a2ad9744935bd1283e7e Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 18 Oct 2026 19:58:53 +0200 Subject: [PATCH] feat(site): hide global chrome on landing pages The index, login and register render their own AuthTopBar, so the shared TopHeader / SiteHeader banner / Navigation duplicated the same chrome. Hide the global chrome on those three standalone landing pages only. --- src/app/(site)/layout.tsx | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/app/(site)/layout.tsx b/src/app/(site)/layout.tsx index 2a18e7a4..59c62110 100644 --- a/src/app/(site)/layout.tsx +++ b/src/app/(site)/layout.tsx @@ -1,4 +1,5 @@ import dynamic from "next/dynamic"; +import { headers } from "next/headers"; import { NextIntlClientProvider } from "next-intl"; import { getLocale, getMessages } from "next-intl/server"; import type { ReactNode } from "react"; @@ -34,28 +35,43 @@ export default async function SiteLayout({ }: { children: ReactNode; }) { - const [session, locale, messages] = await Promise.all([ + const [session, locale, messages, h] = await Promise.all([ auth(), getLocale(), getMessages(), + headers(), ]); const clientMessages = publicClientMessages(messages); + // The landing pages render their own AuthTopBar (logo + live online), so the + // global site banner / navigation is hidden there to keep them clean and + // avoid showing the same chrome twice. Everything else keeps the chrome. + const pathname = h.get("x-pathname"); + const isLandingPage = + pathname === "/" || pathname === "/login" || pathname === "/register"; + return ( {/* Site chrome is public: hiding it all for anonymous visitors used to strand them — from /news, /leaderboard or /shop there was no way to - reach any other page at all. */} -
- -
-
- -
-
- -
+ reach any other page at all. Only the standalone landing pages opt + out, because they carry their own header. */} + {!isLandingPage && ( +
+ +
+ )} + {!isLandingPage && ( +
+ +
+ )} + {!isLandingPage && ( +
+ +
+ )}