Hide site navigation on client proofing pages

This commit is contained in:
2026-10-04 15:49:09 +03:00
parent 15dcbf904e
commit 416fae33a2

View File

@@ -136,6 +136,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
} }
const isAdmin = isAdminPath(pathname); const isAdmin = isAdminPath(pathname);
const isProofPage =
pathname?.startsWith('/proof/') === true ||
pathname?.startsWith('/c/') === true;
const locale = resolveLocale(config.lang); const locale = resolveLocale(config.lang);
const t = getDictionary(locale); const t = getDictionary(locale);
@@ -187,34 +190,55 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<I18nProvider locale={locale}> <I18nProvider locale={locale}>
{siteGated || isAdmin ? ( {siteGated || isAdmin ? (
children children
) : isProofPage ? (
<>
<main id="main-content" tabIndex={-1} className="main">
{children}
</main>
<AssetProtection
disableRightClick={config.protection?.disableRightClick}
disableImageDrag={config.protection?.disableImageDrag}
/>
<AnalyticsTracker />
</>
) : ( ) : (
<> <>
<a href="#main-content" className="skip-link"> <a href="#main-content" className="skip-link">
{t.nav.skipToContent} {t.nav.skipToContent}
</a> </a>
<header className="header"> <header className="header">
<nav className="header__nav" aria-label={t.nav.mainNavAria}> <nav className="header__nav" aria-label={t.nav.mainNavAria}>
{/* Brand wordmark — presets that show it pair it with the dot. */}
<span className="header__wordmark" aria-hidden="true"> <span className="header__wordmark" aria-hidden="true">
{config.siteTitle} {config.siteTitle}
</span> </span>
<MobileNav> <MobileNav>
<NavLink href="/">{t.nav.home}</NavLink> <NavLink href="/">{t.nav.home}</NavLink>
<SubpageNav /> <SubpageNav />
</MobileNav> </MobileNav>
<ThemeToggle /> <ThemeToggle />
</nav> </nav>
</header> </header>
<main id="main-content" tabIndex={-1} className="main"> <main id="main-content" tabIndex={-1} className="main">
{children} {children}
</main> </main>
<Footer /> <Footer />
{config.scrollToTop && <ScrollToTop />} {config.scrollToTop && <ScrollToTop />}
<AssetProtection <AssetProtection
disableRightClick={config.protection?.disableRightClick} disableRightClick={config.protection?.disableRightClick}
disableImageDrag={config.protection?.disableImageDrag} disableImageDrag={config.protection?.disableImageDrag}
/> />
<AnalyticsTracker /> <AnalyticsTracker />
{process.env.NODE_ENV === 'development' && <DevToolbarLoader />} {process.env.NODE_ENV === 'development' && <DevToolbarLoader />}
</> </>
)} )}