diff --git a/src/src/components/header/index.tsx b/src/src/components/header/index.tsx index 701dba8..c0968fe 100644 --- a/src/src/components/header/index.tsx +++ b/src/src/components/header/index.tsx @@ -1,4 +1,3 @@ -// components/header/index.tsx import React, { useState, useEffect, useRef } from "react"; import { Links } from "@/components/header/links"; @@ -19,13 +18,11 @@ export default function Header() { useEffect(() => { if (!isClient) return; - const handleScroll = () => { const currentScrollY = document.documentElement.scrollTop; setVisible(currentScrollY < lastScrollY || currentScrollY < 10); setLastScrollY(currentScrollY); }; - document.addEventListener("scroll", handleScroll); return () => document.removeEventListener("scroll", handleScroll); }, [lastScrollY, isClient]); @@ -39,6 +36,8 @@ export default function Header() { return linkHref !== "/" && path.startsWith(linkHref); }; + const isIndexPage = checkIsActive("/"); + const headerLinks = Links.map((link) => { const isActive = checkIsActive(link.href); @@ -85,9 +84,10 @@ export default function Header() {