ui(admin-panel): responsive dashboard and mobile drawer layout

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
s.esmaeili
2026-10-13 08:53:25 +03:30
co-authored by Cursor
parent 6ccdbc06f0
commit 28b0a4be38
5 changed files with 451 additions and 145 deletions
+6
View File
@@ -27,10 +27,13 @@ export const useLayoutStore = defineStore('layout', {
// legacy state.js: sidebar visibility for the vertical nav menu
isSidebarActive: true,
sidebarCollapsed: readPersistedCollapsed(),
// below the 992 breakpoint the sidebar is an off-canvas drawer; never persisted
mobileNavOpen: false,
}),
getters: {
// legacy used breakpoints of 1200 (theme tour) and 992 (nav menu collapse)
isSmallScreen: (s) => s.windowWidth < 992,
isMobile: (s) => s.windowWidth < 576,
},
actions: {
// legacy mutation: UPDATE_WINDOW_WIDTH
@@ -41,6 +44,9 @@ export const useLayoutStore = defineStore('layout', {
updateWindowScrollY(y: number) {
this.scrollY = y;
},
setMobileNavOpen(value: boolean) {
this.mobileNavOpen = value;
},
toggleSidebar(value?: boolean) {
this.isSidebarActive = value ?? !this.isSidebarActive;
},