Skip to content

Commit 0e066be

Browse files
authored
sidebar menu fixes (#153)
1 parent cd6d34f commit 0e066be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

my-app/src/pages/App.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ function App({ model }) {
2525
return () => {
2626
window.removeEventListener("unload", clearStorageOnUnload);
2727
};
28-
}, []);
28+
}, []);
29+
30+
useState(() => {
31+
if (window.innerWidth < 700) {
32+
setSidebarIsOpen(false);
33+
}
34+
});
2935

3036
return (
3137
/* The sidebar styling(under the menu)*/
@@ -38,7 +44,7 @@ function App({ model }) {
3844
width={
3945
window.innerWidth < 700
4046
? "100%"
41-
: Math.max(window.innerWidth * 0.26, 300)
47+
: Math.min(Math.max(window.innerWidth * 0.26, 300), 400)
4248
}
4349
isOpen={sidebarIsOpen}
4450
onStateChange={(state) => setSidebarIsOpen(state.isOpen)}

0 commit comments

Comments
 (0)