diff --git a/src/components/Layout/TopNav/TopNav.tsx b/src/components/Layout/TopNav/TopNav.tsx index d45da525850..16fdaa21fba 100644 --- a/src/components/Layout/TopNav/TopNav.tsx +++ b/src/components/Layout/TopNav/TopNav.tsx @@ -167,7 +167,6 @@ export default function TopNav({ const asPath = usePathname() || '/'; const [openMenuPath, setOpenMenuPath] = useState(null); const [showSearch, setShowSearch] = useState(false); - const [isScrolled, setIsScrolled] = useState(false); const scrollParentRef = useRef(null); // Deriving from the path hides the menu as soon as a navigation commits. // Forget the path afterwards, so going Back doesn't reopen the menu. @@ -211,24 +210,6 @@ export default function TopNav({ }; }, []); - const scrollDetectorRef = useRef(null); - useEffect(() => { - const observer = new IntersectionObserver( - (entries) => { - entries.forEach((entry) => { - setIsScrolled(!entry.isIntersecting); - }); - }, - { - root: null, - rootMargin: `0px 0px`, - threshold: 0, - } - ); - observer.observe(scrollDetectorRef.current!); - return () => observer.disconnect(); - }, []); - const onOpenSearch = useCallback(() => { startTransition(() => { setShowSearch(true); @@ -245,7 +226,6 @@ export default function TopNav({ onOpen={onOpenSearch} onClose={onCloseSearch} /> -