setup route for first user

This commit is contained in:
Julian Krauser 2024-08-25 13:37:23 +02:00
parent 91ff0835fb
commit 6d9e75bb0c
20 changed files with 455 additions and 30 deletions

View file

@ -44,6 +44,11 @@ export const useNavigationStore = defineStore("navigation", {
title: "Einstellungen",
levelDefault: "#qualification",
},
{
key: "user",
title: "Benutzer",
levelDefault: "#user",
},
] as Array<topLevelNavigationModel>,
navigation: {
club: {
@ -112,6 +117,7 @@ export const useNavigationStore = defineStore("navigation", {
],
},
} as navigationModel,
componentOverwrite: null as null | any,
};
},
getters: {
@ -144,6 +150,12 @@ export const useNavigationStore = defineStore("navigation", {
setTopLevelNav(topLeveLinks: Array<topLevelNavigationModel>) {
this.topLevel = topLeveLinks;
},
setComponentOverwrite(component: any) {
this.componentOverwrite = component;
},
resetComponentOverwrite() {
this.componentOverwrite = null;
},
resetNavigation() {
this.$reset();
},

View file

@ -0,0 +1,32 @@
import { defineStore } from "pinia";
export const useContextMenuStore = defineStore("context-menu", {
state: () => {
return {
contextX: 0,
contextY: 0,
show: false,
component_ref: null as any,
data: null as any,
};
},
getters: {
contextMenuStyle: (state) => {
return `left: ${state.contextX}px; top: ${state.contextY}px`;
},
},
actions: {
openContextMenu(e: MouseEvent, content: { component_ref: any; data: any }) {
this.component_ref = content.component_ref;
this.data = content.data;
this.contextX = e.pageX;
this.contextY = e.pageY;
this.show = true;
},
closeContextMenu() {
this.component_ref = null;
this.data = null;
this.show = false;
},
},
});

23
src/stores/modal.ts Normal file
View file

@ -0,0 +1,23 @@
import { defineStore } from "pinia";
export const useModalStore = defineStore("modal", {
state: () => {
return {
show: false,
component_ref: null as any,
data: null as any,
};
},
actions: {
openModal(component_ref: any, data?: any) {
this.component_ref = component_ref;
this.data = data;
this.show = true;
},
closeModal() {
this.component_ref = null;
this.data = null;
this.show = false;
},
},
});