From 713f555a6ef551e110e3d16b87377bb60ebee63e Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Wed, 21 Oct 2026 14:33:48 +0000 Subject: [PATCH] Fix navbar: one row on desktop, menu dropdown below lg The header crammed 8 links into a max-w-3xl flex-wrap row, so the logo wrapped to two lines, 'status' orphaned onto a second row on desktop and mobile got a ragged three-line block. Widen the header to max-w-5xl, keep logo and links on one line, and fold the links into a
menu below lg that closes on client navigation. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/app/layout.tsx | 20 +-------- apps/web/src/components/site-nav.tsx | 62 ++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 apps/web/src/components/site-nav.tsx diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index b02ce4b..d3e21ee 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -5,6 +5,7 @@ import Script from "next/script"; import { Footer } from "@profullstack/footer/react"; import { WebMcpProvider } from "@/components/webmcp-provider"; import { PitFooter } from "@/components/pit-footer"; +import { SiteNav } from "@/components/site-nav"; const SITE = "https://c0mpute.com"; const DESCRIPTION = @@ -55,24 +56,7 @@ export default function RootLayout({
- +
{children}
diff --git a/apps/web/src/components/site-nav.tsx b/apps/web/src/components/site-nav.tsx new file mode 100644 index 0000000..badca03 --- /dev/null +++ b/apps/web/src/components/site-nav.tsx @@ -0,0 +1,62 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { useEffect, useRef } from "react"; + +const LINKS: { href: string; label: string; accent?: boolean }[] = [ + { href: "/getting-started", label: "getting-started" }, + { href: "/protocol", label: "protocol" }, + { href: "/providers", label: "run a node", accent: true }, + { href: "/nodes", label: "nodes" }, + { href: "/agents", label: "agents" }, + { href: "/plugins", label: "plugins" }, + { href: "/docs", label: "docs" }, + { href: "/status", label: "status" }, +]; + +// One row on desktop; below lg the links fold into a
menu, which works +// without JS. The effect only closes it again after a client-side navigation. +export function SiteNav() { + const pathname = usePathname(); + const menu = useRef(null); + useEffect(() => { + if (menu.current) menu.current.open = false; + }, [pathname]); + + const linkClass = (accent?: boolean) => + `!border-0 whitespace-nowrap hover:text-[var(--color-accent)] ${accent ? "accent" : ""}`; + + return ( + + ); +}