diff --git a/src/components/site-header.tsx b/src/components/site-header.tsx index df56a851..138e641a 100644 --- a/src/components/site-header.tsx +++ b/src/components/site-header.tsx @@ -2,7 +2,7 @@ import { Menu, X } from "lucide-react"; import Link from "next/link"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import { SiteLogoSwitcher } from "@/components/site-logo-switcher"; import { ThemeToggle } from "@/components/theme-toggle"; @@ -24,10 +24,6 @@ const NAV = [ export function SiteHeader() { const [open, setOpen] = useState(false); - const headerRef = useRef(null); - // Initial estimate matches the rendered header height so the spacer - // doesn't jump on first paint; ResizeObserver refines it after mount. - const [headerH, setHeaderH] = useState(64); // Close the mobile menu when the viewport crosses md so the dropdown // doesn't stick around as the desktop nav reappears. @@ -41,29 +37,16 @@ export function SiteHeader() { return () => mql.removeEventListener("change", onChange); }, [open]); - // Measure the fixed header so we can reserve the same height in the - // flow with a spacer. ResizeObserver picks up viewport resizes. - useEffect(() => { - const el = headerRef.current; - if (!el) return; - const update = () => setHeaderH(el.offsetHeight); - update(); - const ro = new ResizeObserver(update); - ro.observe(el); - return () => ro.disconnect(); - }, []); - return ( - <> -
+
@@ -148,10 +131,6 @@ export function SiteHeader() { )}
-
- {/* Spacer reserves the fixed header's height in the document flow - so page content does not start under it. */} -
- +
); }