Skip to content

Commit

Permalink
Fix mobile nav menu context scoping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Sep 10, 2024
1 parent e46ce03 commit 3e139df
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions shared/common/ui/navtabs/mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ export function MobileNavTabs({
Link,
extraMenu,
}: MobileNavTabsProps) {
const {openModal} = useModal();
const {modal, openModal} = useModal(
<MobileMenu
tabs={tabs}
currentTabId={currentTabId}
Link={Link}
extraMenu={extraMenu}
/>
);
const modalDisposer = useRef<null | (() => void)>(null);
const windowWidth = useWindowWidth();

Expand Down Expand Up @@ -54,19 +61,11 @@ export function MobileNavTabs({
</div>
<div
className={styles.menuButton}
onClick={() =>
(modalDisposer.current = openModal(
<MobileMenu
tabs={tabs}
currentTabId={currentTabId}
Link={Link}
extraMenu={extraMenu}
/>
))
}
onClick={() => (modalDisposer.current = openModal())}
>
<EllipsisIcon />
</div>
{modal}
</div>
);
}
Expand Down

0 comments on commit 3e139df

Please sign in to comment.