From a8e5c07db0c8fe1b92973dd3f132a42d70b867ef Mon Sep 17 00:00:00 2001 From: SANTHSIM22 Date: Sun, 27 Oct 2024 20:19:58 +0530 Subject: [PATCH] refactor : navbar --- src/components/edil-ozi/text-glitch.tsx | 4 +- src/components/navbar/nav-header.tsx | 98 ++++++++++++++----------- src/components/navbar/nav-items.tsx | 6 +- 3 files changed, 60 insertions(+), 48 deletions(-) diff --git a/src/components/edil-ozi/text-glitch.tsx b/src/components/edil-ozi/text-glitch.tsx index 5161bcb..7c46628 100644 --- a/src/components/edil-ozi/text-glitch.tsx +++ b/src/components/edil-ozi/text-glitch.tsx @@ -17,10 +17,10 @@ const TextGlitchEffect: FC = ({ textOne, textTwo, className }) => { )} > {textOne} - + {textOne} - + {textTwo} diff --git a/src/components/navbar/nav-header.tsx b/src/components/navbar/nav-header.tsx index 7679d1a..09b6677 100644 --- a/src/components/navbar/nav-header.tsx +++ b/src/components/navbar/nav-header.tsx @@ -11,52 +11,64 @@ interface NavHeaderProps { const NavHeader: React.FC = ({ handleClick }) => { const menuToggle = useRef(null); - return ( + + const handleMenuClick = () => { + handleClick(); + + // Toggle overflow style on the body to enable/disable scrolling + if (document.body.style.overflow === "hidden") { + document.body.style.overflow = "auto"; + } else { + document.body.style.overflow = "hidden"; + } + }; + + return ( <> -
-
-
- - logo - -
-
- + + + + + + +
- -
+ ); }; diff --git a/src/components/navbar/nav-items.tsx b/src/components/navbar/nav-items.tsx index f386673..e96dd01 100644 --- a/src/components/navbar/nav-items.tsx +++ b/src/components/navbar/nav-items.tsx @@ -9,17 +9,17 @@ type NavItemProps = { const NavItem = ({ href, textOne, textTwo }: NavItemProps) => { return ( -
  • +