mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
6c9c32e275
The geistdocs facelift (#1666) dropped the VERCEL_ENV-based filter on nav items, so the "Internal" entry (preview: true) was visible on the production docs deployment. Restore the filter in the server-rendered Navbar and pass the filtered list to MobileMenu so both desktop and mobile honor it. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import { basePath, Logo, nav, suggestions } from '@/geistdocs';
|
|
import { Chat } from './chat';
|
|
import { DesktopMenu } from './desktop-menu';
|
|
import { MobileMenu } from './mobile-menu';
|
|
import { NavbarLogo } from './navbar-logo';
|
|
import { SearchButton } from './search';
|
|
|
|
export const Navbar = () => {
|
|
const isPreview =
|
|
process.env.VERCEL_ENV === 'preview' ||
|
|
process.env.NODE_ENV === 'development';
|
|
|
|
// Filter nav items: show preview-only entries in preview/dev environments
|
|
const visibleNav = nav.filter((item) => !item.preview || isPreview);
|
|
|
|
return (
|
|
<header className="sticky top-0 z-40 flex h-16 justify-center border-b bg-background-200">
|
|
<div className="mx-auto flex w-full max-w-[1448px] justify-between px-2">
|
|
<div className="flex select-none flex-row items-center">
|
|
<NavbarLogo className="ml-4" logo={<Logo />} variant="oss" />
|
|
<DesktopMenu className="hidden pl-6 lg:flex" items={visibleNav} />
|
|
</div>
|
|
<div className="mr-4 flex flex-row items-center justify-end gap-2">
|
|
<SearchButton className="hidden lg:flex" />
|
|
<Chat basePath={basePath} suggestions={suggestions} />
|
|
<MobileMenu items={visibleNav} />
|
|
</div>
|
|
</div>
|
|
</header>
|
|
);
|
|
};
|