We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de2788b commit 3650570Copy full SHA for 3650570
1 file changed
client/app/components/Header/index.jsx
@@ -36,6 +36,15 @@ export const Header = ({
36
37
useFocusTrap(navigationRef, mobileNavOpen);
38
39
+ useEffect(() => {
40
+ const mediaQuery = window.matchMedia('(max-width: 1024px)');
41
+ const handleChange = ({ matches }) => {
42
+ if (!matches) setMobileNavOpen(false);
43
+ };
44
+ mediaQuery.addEventListener('change', handleChange);
45
+ return () => mediaQuery.removeEventListener('change', handleChange);
46
+ }, []);
47
+
48
const toggle = (): void => {
49
setMobileNavOpen((currentNavValue) => !currentNavValue);
50
};
0 commit comments