fix mobile issue

This commit is contained in:
2026-08-06 17:09:08 +05:30
parent cec6f0f412
commit 469ad3021c
3 changed files with 11 additions and 5 deletions

View File

@@ -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}