fix mobile issue
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import {useRef} from 'react';
|
||||
import {useEffect, useRef} from 'react';
|
||||
import {MobileNav} from '@astryxdesign/core/MobileNav';
|
||||
import {SideNavItem, SideNavSection} from '@astryxdesign/core/SideNav';
|
||||
import {Divider} from '@astryxdesign/core/Divider';
|
||||
@@ -64,6 +64,11 @@ export function MobileMenu() {
|
||||
const {isDrawerOpen, setDrawerOpen, closeDrawer} = useSidebar();
|
||||
const touchStart = useRef<{x: number; y: number} | null>(null);
|
||||
|
||||
// Automatically close mobile menu on route change
|
||||
useEffect(() => {
|
||||
closeDrawer();
|
||||
}, [pathname, closeDrawer]);
|
||||
|
||||
return (
|
||||
<MobileNav
|
||||
id={NAV_DRAWER_ID}
|
||||
|
||||
Reference in New Issue
Block a user