From 0302c5301ddc0fc75e5187d3604b020a209e0405 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sun, 26 Mar 2023 17:21:23 +0800 Subject: [PATCH] hide sidemenu for mobile --- src/components/Menu/Menu.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 9bc8001..f6abf85 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -14,6 +14,7 @@ const Menu = () => { const setHideSideMenu = useStore((state) => state.setHideSideMenu); useEffect(() => { + if (window.innerWidth < 768) setHideSideMenu(true); window.addEventListener('resize', () => { if (window.innerWidth < 768) setHideSideMenu(true); });