From 5681e4b1adf059bd3549b000d73e06a546413661 Mon Sep 17 00:00:00 2001 From: Timothy Pidashev Date: Wed, 8 Jan 2025 10:51:23 -0800 Subject: [PATCH] Update header --- src/src/components/header/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() {