Skip to content

Commit

Permalink
fix: close menu after mobile navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
antonlovric committed Feb 11, 2024
1 parent 0799642 commit cb30468
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const Header = () => {
mobileMenu.current?.classList.toggle('hidden');
};

const handleLinkClick = () => menuHandler();

return (
<header>
<img height={100} src='/assets/logo.webp' alt='' />
Expand All @@ -40,7 +42,7 @@ const Header = () => {
</div>
<nav ref={mobileMenu} className='nav-links__mobile hidden'>
{navLinks.map((link: INavLink) => (
<a key={link.name} href={link.href}>
<a onClick={handleLinkClick} key={link.name} href={link.href}>
{link.name}
</a>
))}
Expand Down

0 comments on commit cb30468

Please sign in to comment.