From e59ef80353fa65a4f90dd8f5fe129797efbe78fc Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Thu, 7 Nov 2024 18:18:38 +0100 Subject: [PATCH] fix: hide the mobile menu when the link in the menu is clicked --- components/Header.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/Header.jsx b/components/Header.jsx index 1308832..13b5af0 100644 --- a/components/Header.jsx +++ b/components/Header.jsx @@ -133,6 +133,9 @@ function Header({ docLinks }) { href={navLink.href} target={navLink.target} className={`inline-block align-middle ${pathname == navLink.href || (navLink.href != "/" && pathname.indexOf(navLink.href + "/") == 0) ? "bg-accent" : ""} text-inherit px-2 py-1 mx-1 rounded-sm hover:bg-accent/60 transition-colors`} + onClick={() => { + setMenuShown(false); + }} > {navLink.label} @@ -143,6 +146,9 @@ function Header({ docLinks }) { href={headerLinks.git.href} target={headerLinks.git.target} className="whitespace-nowrap inline-block align-middle text-inherit px-2 py-1 h-8 mx-1 rounded-sm hover:bg-accent/60 transition-colors" + onClick={() => { + setMenuShown(false); + }} > { + setMenuShown(false); + }} > {docLink.label}