From e2d98f08c529e09484051e60ef4e13471b95f882 Mon Sep 17 00:00:00 2001 From: marcoskolodny Date: Tue, 29 Oct 2024 17:20:52 +0100 Subject: [PATCH] cleanup cod --- src/navigation-bar.tsx | 129 +++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 68 deletions(-) diff --git a/src/navigation-bar.tsx b/src/navigation-bar.tsx index 6d95f2177..1866ccf09 100644 --- a/src/navigation-bar.tsx +++ b/src/navigation-bar.tsx @@ -239,7 +239,6 @@ const MainNavigationBarBurgerMenu = ({ closeMenu, open, id, - disableFocusTrap, setDisableFocusTrap, }: { sections: ReadonlyArray; @@ -247,7 +246,6 @@ const MainNavigationBarBurgerMenu = ({ closeMenu: () => void; open: boolean; id: string; - disableFocusTrap: boolean; setDisableFocusTrap: (value: boolean) => void; }) => { const {texts, t} = useTheme(); @@ -353,66 +351,64 @@ const MainNavigationBarBurgerMenu = ({ mountOnEnter unmountOnExit > - - - + {(transitionStatus) => ( +
+ {transitionStatus !== 'entered' && ( +
+ + + + {sections.map( + ({title, menu, ...interactiveProps}, index) => ( + { + setIsSubMenuOpen(true); + setOpenedSection(index); + }, + } + : getInteractivePropsWithCloseMenu( + interactiveProps + ))} + /> + ) + )} + + + {extra && {extra}} + +
+ )} + + {transitionStatus !== 'exited' && openedSection !== -1 && ( +
+ {renderSection(openedSection)} +
+ )} +
+ )} + + ); @@ -867,20 +863,17 @@ export const MainNavigationBar = ({ } return ( - <> - - {mainNavBar} - + + {mainNavBar} setIsBurgerMenuOpen(false)} - disableFocusTrap={disableFocusTrap} + closeMenu={closeMenu} setDisableFocusTrap={setDisableFocusTrap} /> - + ); };