Hide site navigation on client proofing pages
This commit is contained in:
@@ -136,6 +136,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
}
|
||||
|
||||
const isAdmin = isAdminPath(pathname);
|
||||
const isProofPage =
|
||||
pathname?.startsWith('/proof/') === true ||
|
||||
pathname?.startsWith('/c/') === true;
|
||||
const locale = resolveLocale(config.lang);
|
||||
const t = getDictionary(locale);
|
||||
|
||||
@@ -187,34 +190,55 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
<I18nProvider locale={locale}>
|
||||
{siteGated || isAdmin ? (
|
||||
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">
|
||||
{t.nav.skipToContent}
|
||||
</a>
|
||||
|
||||
<header className="header">
|
||||
<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">
|
||||
{config.siteTitle}
|
||||
</span>
|
||||
|
||||
<MobileNav>
|
||||
<NavLink href="/">{t.nav.home}</NavLink>
|
||||
<SubpageNav />
|
||||
</MobileNav>
|
||||
|
||||
<ThemeToggle />
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="main-content" tabIndex={-1} className="main">
|
||||
{children}
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
|
||||
{config.scrollToTop && <ScrollToTop />}
|
||||
|
||||
<AssetProtection
|
||||
disableRightClick={config.protection?.disableRightClick}
|
||||
disableImageDrag={config.protection?.disableImageDrag}
|
||||
/>
|
||||
|
||||
<AnalyticsTracker />
|
||||
|
||||
{process.env.NODE_ENV === 'development' && <DevToolbarLoader />}
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user