From 2635f931c9c90242a9e911ca7f52ef52285736c5 Mon Sep 17 00:00:00 2001 From: Chee Kian Teoh Date: Fri, 29 Mar 2024 14:22:19 -0400 Subject: [PATCH] Fix add extra scroll padding --- src/components/Navbar/NavItems.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/Navbar/NavItems.tsx b/src/components/Navbar/NavItems.tsx index 99d9d236..f0813776 100644 --- a/src/components/Navbar/NavItems.tsx +++ b/src/components/Navbar/NavItems.tsx @@ -17,10 +17,8 @@ const links = [ const rowStyle = 'flex-row items-center'; const colStyle = 'flex-col lg:p-0'; -// got a hardcoded value here? -// do i want to get the value dynamically? -// maybe no need, the navbar is always 80px -const scrollPaddingPx = -80; +const navbarHeightPx = 80; +const scrollPaddingPx = -(navbarHeightPx + 20); // navbarHeight + extra padding const NavItems: React.FC = ({ isHorizontal, handleClick }) => { return ( @@ -37,9 +35,9 @@ const NavItems: React.FC = ({ isHorizontal, handleClick }) => { duration={500} offset={scrollPaddingPx} onClick={() => { - console.log("hello world") - // hide the side menu - + console.log('hello world'); + // hide the side menu + // hideMenu() }} className="text-md" >