import MobileMenu from "./MobileMenu" import NavbarItem from "./NavbarItem" import { BsChevronDown,BsSearch,BsBell } from "react-icons/bs" import { useCallback,useState,useEffect } from "react" import AccountMenu from "./AccountMenu"; function Navbar() { const [showMobileMenu,setShowMobileMenu] = useState(false); const [showAccountMenu,setshowAccountMenu] = useState(false); const [showBackground,setShowBackground] = useState(false); const TOP_OFFSET = 66; useEffect(() => { const handleScroll = () => { if(window.scrollY >= TOP_OFFSET){ setShowBackground(true); }else{ setShowBackground(false) } } window.addEventListener('scroll',handleScroll); return () => { window.removeEventListener('scroll',handleScroll); } },[]) const toggleMobileMenu = useCallback(()=>{ setShowMobileMenu((currentvisible) => !currentvisible) },[]); const toggleAccountMenu = useCallback(()=>{ setshowAccountMenu((currentvisible) => !currentvisible) },[]); return ( ) } export default Navbar