From 0dcc3e5e46f7e0ff59342c5620069d456fc53a6c Mon Sep 17 00:00:00 2001 From: SatyamSetia Date: Wed, 1 Nov 2023 16:27:39 +0530 Subject: [PATCH] fix: close mobile nav on blur of nav list --- components/Header/Header.tsx | 13 ++++++------- components/Layout/Layout.tsx | 15 +++++++++------ components/Nav/NavItem.tsx | 5 ++++- components/Nav/NavPrimaryMobile.tsx | 17 +++++++++++++---- stories/Header.stories.tsx | 2 +- stories/NavPrimaryMobile.stories.tsx | 2 +- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/components/Header/Header.tsx b/components/Header/Header.tsx index 57ee4d6..ebaafc4 100644 --- a/components/Header/Header.tsx +++ b/components/Header/Header.tsx @@ -6,10 +6,10 @@ import styles from "./Header.module.css" export interface IHeaderProps { handleNavClick: () => void - showNavMobile: boolean + isNavMobileOpen: boolean } -export const Header = ({ handleNavClick, showNavMobile }: IHeaderProps) => { +export const Header = ({ handleNavClick, isNavMobileOpen }: IHeaderProps) => { return ( <>
@@ -21,12 +21,11 @@ export const Header = ({ handleNavClick, showNavMobile }: IHeaderProps) => { className={styles.hamburgerBtn} onClick={handleNavClick} aria-label="Navigation menu" - aria-expanded={showNavMobile}> - {!showNavMobile && ( -