From a1a4da7e146f5bb53c93870c3eaa4d796796dda7 Mon Sep 17 00:00:00 2001 From: Chee Kian Teoh Date: Thu, 22 Feb 2024 21:19:11 -0500 Subject: [PATCH 1/5] fix: remove the overlapping button and mlh flag --- src/components/Navbar/Navbar.tsx | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index eea7e14e..6dceb618 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -1,30 +1,25 @@ import { useEffect, useState } from 'react'; -import { useWindowScroll } from '@uidotdev/usehooks'; import Hamburger from 'hamburger-react'; import { NavItems, Menu } from '@components'; const Navbar = () => { - const [scrollPos] = useWindowScroll(); - const scrollPosY = scrollPos.y as number; - const [showMenu, setShowMenu] = useState(false); const hideMenu = () => setShowMenu(false); useEffect(() => { - if (showMenu) document.body.classList.add('overflow-y-hidden') + if (showMenu) document.body.classList.add('overflow-y-hidden'); else document.body.classList.remove('overflow-y-hidden'); }, [showMenu]); return ( -