Skip to content

Commit 9ce1016

Browse files
committed
Merge branch 'main' of github.com:jkluge/Find-My-Next-Course into searchbar-fix
2 parents 94ea336 + 0e066be commit 9ce1016

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

my-app/src/pages/App.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ function App({ model }) {
2626
// window.removeEventListener("unload", clearStorageOnUnload);
2727
// };
2828
// }, []);
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)