diff --git a/components/Navbar/navbar.js b/components/Navbar/navbar.js index c3ceab1f..7d84b2b1 100644 --- a/components/Navbar/navbar.js +++ b/components/Navbar/navbar.js @@ -18,7 +18,7 @@ function Navbar() { const svg = useRef(null); const handleClosing = useCallback((event) => { if (show && !event.target.closest('.subMenu')) { - setShow(false); + setShow(null); } }, [show]); useEffect(() => { @@ -26,12 +26,12 @@ function Navbar() { return () => { document.removeEventListener('mousedown', handleClosing); }; - }, [handleClosing, show]); + }, [handleClosing]); const handleCloseMenu = (event) => { if (menuRef.current && !menuRef.current.contains(event.target)) { setDrop(false); - } if (svg.current && event.target == svg.current) { + } if (svg.current && event.target === svg.current) { setDrop(true); } }; @@ -43,12 +43,14 @@ function Navbar() { }; }, [menuRef]); - const handleVenueHover = () => { - setShow('Venue'); + const handleMouseEnter = (title) => { + setShow(title); }; - const handleSubMenuLeave = () => { + + const handleMouseLeave = () => { setShow(null); }; + return (