Skip to content

Commit

Permalink
Fix add extra scroll padding
Browse files Browse the repository at this point in the history
  • Loading branch information
teoh4770 committed Mar 29, 2024
1 parent 2d7c776 commit 2635f93
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/Navbar/NavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<NavItemsProps> = ({ isHorizontal, handleClick }) => {
return (
Expand All @@ -37,9 +35,9 @@ const NavItems: React.FC<NavItemsProps> = ({ 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"
>
Expand Down

0 comments on commit 2635f93

Please sign in to comment.