From 699297bfb7f018d8affed5d603f883e3b3f0b6f4 Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Tue, 30 Jul 2024 11:33:39 -0500 Subject: [PATCH] Revert "feat: nav appears on page scroll (#537)" This reverts commit 500a196fae5da9fe3590de6b28cb891cf22a3021. --- src/components/others/TableOfContents.tsx | 9 +++------ src/hooks/useScrollPosition.ts | 19 ------------------- 2 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 src/hooks/useScrollPosition.ts diff --git a/src/components/others/TableOfContents.tsx b/src/components/others/TableOfContents.tsx index b8cd15bf..8fb3a584 100644 --- a/src/components/others/TableOfContents.tsx +++ b/src/components/others/TableOfContents.tsx @@ -4,7 +4,6 @@ import Link from "next/link"; import { cn } from "@/lib/utils"; import { useEffect, useRef, useState } from "react"; import { usePathname } from "next/navigation"; -import { useScrollPosition } from "../../hooks/useScrollPosition"; /** * Automatically query all the heading anchors inside the
and creates a table of contents @@ -29,7 +28,6 @@ export function TableOfContentsSideBar(props: { filterHeading?: (heading: HTMLHeadingElement) => boolean; linkClassName?: string; }) { - const scrollPosition = useScrollPosition(); const [nodes, setNodes] = useState([]); const tocRef = useRef(null); const pathname = usePathname(); @@ -108,13 +106,12 @@ export function TableOfContentsSideBar(props: { observer.disconnect(); }; }, [pathname, filterHeading]); - + return (