hide sidemenu for mobile

This commit is contained in:
Jing Hua 2023-03-26 17:21:23 +08:00
parent d4e72532a8
commit 0302c5301d

View file

@ -14,6 +14,7 @@ const Menu = () => {
const setHideSideMenu = useStore((state) => state.setHideSideMenu); const setHideSideMenu = useStore((state) => state.setHideSideMenu);
useEffect(() => { useEffect(() => {
if (window.innerWidth < 768) setHideSideMenu(true);
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
if (window.innerWidth < 768) setHideSideMenu(true); if (window.innerWidth < 768) setHideSideMenu(true);
}); });