Progmasoft Git

progmaweb

The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.

Clonegit clone https://git.progmasoft.com/progmaweb

Give the header menu callbacks block bodies

Codacy's no-confusing-void-expression flags arrow shorthands that return
the void result of removeEventListener and setOpen.

Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
Commit
d8e977fa6d16539addf90e58028856477d166e5c
Author
Leitwolf11 ·
Parents
537b1f3a4a60

Files · Download .tar.gz

Changes

 apps/web/components/HeaderMenu.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/apps/web/components/HeaderMenu.tsx b/apps/web/components/HeaderMenu.tsx
index 6ad8145..6a213c0 100644
--- a/apps/web/components/HeaderMenu.tsx
+++ b/apps/web/components/HeaderMenu.tsx
@@ -35,7 +35,9 @@ export function HeaderMenu({
       if (event.key === "Escape") setOpen(false);
     };
     window.addEventListener("keydown", onKey);
-    return () => window.removeEventListener("keydown", onKey);
+    return () => {
+      window.removeEventListener("keydown", onKey);
+    };
   }, [open]);
 
   return (
@@ -45,7 +47,9 @@ export function HeaderMenu({
         aria-expanded={open}
         aria-label={open ? closeLabel : menuLabel}
         className="menu-toggle"
-        onClick={() => setOpen((value) => !value)}
+        onClick={() => {
+          setOpen((value) => !value);
+        }}
         type="button"
       >
         <span aria-hidden="true" className="menu-toggle-bars" />