fix(web): increase sidebar breakpoint (#17436)

This commit is contained in:
Ben
2025-04-10 13:00:30 -04:00
committed by GitHub
parent 6d3f3d8616
commit e3995fb5f4
9 changed files with 145 additions and 49 deletions
@@ -2,6 +2,7 @@ import { MediaQuery } from 'svelte/reactivity';
const pointerCoarse = new MediaQuery('pointer:coarse');
const maxMd = new MediaQuery('max-width: 767px');
const sidebar = new MediaQuery(`min-width: 850px`);
export const mobileDevice = {
get pointerCoarse() {
@@ -10,4 +11,7 @@ export const mobileDevice = {
get maxMd() {
return maxMd.current;
},
get isFullSidebar() {
return sidebar.current;
},
};
-1
View File
@@ -1 +0,0 @@
export const isSidebarOpen = $state({ value: false });
+21
View File
@@ -0,0 +1,21 @@
import { mobileDevice } from '$lib/stores/mobile-device.svelte';
class SidebarStore {
isOpen = $derived.by(() => mobileDevice.isFullSidebar);
/**
* Reset the sidebar visibility to the default, based on the current screen width.
*/
reset() {
this.isOpen = mobileDevice.isFullSidebar;
}
/**
* Toggles the sidebar visibility, if available at the current screen width.
*/
toggle() {
this.isOpen = mobileDevice.isFullSidebar ? true : !this.isOpen;
}
}
export const sidebarStore = new SidebarStore();