"use client"; import { useEffect, useState } from "react"; import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/solid"; import NavPages from "./NavPages"; import logo from "@/public/content/logo.png"; import logo_small from "@/public/content/logo_small.png"; import Image from "next/image"; import { usePathname } from "next/navigation"; const Navbar = () => { const [isTopOfPage, setIsTopOfPage] = useState(true); const [menuActive, setMenuActive] = useState(false); const currentPage = "/" + usePathname().split("/")[1]; useEffect(() => { const handleScroll = () => { if (window.scrollY === 0) { setIsTopOfPage(true); } else { setIsTopOfPage(false); } }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const useSmallNav: boolean = isTopOfPage && currentPage === "/"; return ( ); }; export default Navbar;