ui(admin-panel): responsive dashboard and mobile drawer layout
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user