Skip to content

Commit

Permalink
fix: make other sections' anchors to be at the good position
Browse files Browse the repository at this point in the history
  • Loading branch information
teoh4770 committed Mar 29, 2024
1 parent a1ed716 commit 98cedaf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/Navbar/NavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ interface NavItemsProps {

const links = [
{ title: 'About', href: 'about-anchor' },
{ title: 'Sponsors', href: 'sponsors-anchor' },
{ title: 'Partners', href: 'partners-anchor' },
{ title: 'FAQ', href: 'faq-anchor' },
{ title: 'Sponsors', href: 'sponsors-anchor', offset: 200 },
{ title: 'Partners', href: 'partners-anchor', offset: 20 },
{ title: 'FAQ', href: 'faq-anchor', offset: 120 },
{ title: 'The Team', href: 'team-anchor' },
{ title: 'Contact', href: 'contact-anchor' },
{ title: 'Contact', href: 'contact-anchor', offset: 500 },
];

const rowStyle = 'flex-row items-center';
Expand All @@ -32,7 +32,11 @@ const NavItems: React.FC<NavItemsProps> = ({ isHorizontal, handleClick }) => {
to={link.href}
smooth
duration={500}
offset={scrollPaddingPx}
offset={
link.offset
? -link.offset + scrollPaddingPx
: scrollPaddingPx
}
className="text-md w-full"
onClick={handleClick}
>
Expand Down

0 comments on commit 98cedaf

Please sign in to comment.