feat(settings): render top and bottom bar, implement notifications stack and submenu navigation

This commit is contained in:
2025-11-26 11:07:03 +01:00
parent 9858ef0b07
commit d37a793488
16 changed files with 169 additions and 24 deletions

View File

@@ -1,23 +1,37 @@
export const useSettingsStore = defineStore("settings", {
state: () => ({
activeMenu: null as string | null,
navigationStack: [] as string[],
}),
getters: {
isMenuOpen: (state) => (menu: string) => {
if (!state.activeMenu) return false;
return new RegExp(`^${menu}[A-Z]`).test(state.activeMenu);
},
isAnyOtherMenuOpen: (state) => (excludeMenu: string) => {
if (!state.activeMenu) return false;
const menus = ["options", "clock", "user", "touchScreen"];
return menus
return ["options", "clock", "user", "touchScreen"]
.filter((m) => m !== excludeMenu)
.some((m) => new RegExp(`^${m}[A-Z]`).test(state.activeMenu!));
},
currentView: (state) => {
if (state.navigationStack.length === 0) return "menu";
return state.navigationStack[state.navigationStack.length - 1];
},
},
actions: {
setActiveMenu(menu: string | null) {
this.activeMenu = menu;
},
pushNavigation(view: string) {
this.navigationStack.push(view);
},
popNavigation() {
this.navigationStack.pop();
},
},
});