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 ( <> -
+
@@ -63,17 +59,53 @@ const Navbar = () => {
-
{ setShowMenu('')}}>HOME
-
{ setShowMenu('')}}>RENTALS
-
{ setShowMenu('')}}>ABOUT
-
{ setShowMenu('')}}>CONTACT
+ +
{ + setShowMenu(""); + }} + > + HOME +
+
+ +
{ + setShowMenu(""); + }} + > + RENTALS +
+
+ +
{ + setShowMenu(""); + }} + > + ABOUT +
+
+ +
{ + setShowMenu(""); + }} + > + CONTACT +
+
@@ -82,24 +114,23 @@ const Navbar = () => {
- - - + + +
- ) - } - else{ - window.onscroll = () => {} + ); + } else { + window.onscroll = () => {}; } return ( @@ -127,13 +158,13 @@ const Navbar = () => { - +
{ id="navbar-sticky" >