diff --git a/src/components/Header-section/Navbar.jsx b/src/components/Header-section/Navbar.jsx index 8567b078..007c5499 100644 --- a/src/components/Header-section/Navbar.jsx +++ b/src/components/Header-section/Navbar.jsx @@ -28,28 +28,24 @@ const Navbar = () => { }; }, []); - - - if(showMenu){ - - const scrollTop = - window.pageYOffset || document.documentElement.scrollTop; - const scrollLeft = - window.pageXOffset || document.documentElement.scrollLeft + if (showMenu) { + const scrollTop = window.pageYOffset || document.documentElement.scrollTop; + const scrollLeft = + window.pageXOffset || document.documentElement.scrollLeft; window.onscroll = () => { - window.scrollTo(scrollLeft, scrollTop) - } + window.scrollTo(scrollLeft, scrollTop); + }; - return( + return ( <> -