diff --git a/src/components/UnifiedNavigation.tsx b/src/components/UnifiedNavigation.tsx index 2eb9e6b..58e45ee 100644 --- a/src/components/UnifiedNavigation.tsx +++ b/src/components/UnifiedNavigation.tsx @@ -113,6 +113,22 @@ export default function UnifiedNavigation() { setAccountMenuOpen(false); }, [user]); + useEffect(() => { + setMenuOpen(false); + }, [pathname]); + + useEffect(() => { + if (typeof document === "undefined") { + return; + } + + document.body.style.overflow = menuOpen ? "hidden" : ""; + + return () => { + document.body.style.overflow = ""; + }; + }, [menuOpen]); + useEffect(() => { if (typeof window === "undefined") { return; @@ -167,13 +183,13 @@ export default function UnifiedNavigation() { const isHiddenRoute = pathname ? [ - "/login", - "/register", - "/xstream", - "/xcloudflow", - "/xscopehub", - "/blogs", - ].some((prefix) => pathname.startsWith(prefix)) + "/login", + "/register", + "/xstream", + "/xcloudflow", + "/xscopehub", + "/blogs", + ].some((prefix) => pathname.startsWith(prefix)) : false; if (isHiddenRoute) { @@ -197,10 +213,27 @@ export default function UnifiedNavigation() { }} className="sticky top-0 z-50 w-full border-b border-surface-border bg-background/95 text-text backdrop-blur transition-colors duration-150" > -