main layout
This commit is contained in:
parent
62990170de
commit
f1e6e8b8d3
38 changed files with 1353 additions and 20 deletions
38
src/components/admin/RoutingLink.vue
Normal file
38
src/components/admin/RoutingLink.vue
Normal file
|
@ -0,0 +1,38 @@
|
|||
<template>
|
||||
<div
|
||||
v-if="link"
|
||||
class="cursor-pointer w-full px-2 py-3"
|
||||
:class="
|
||||
activeLink?.key == link.key
|
||||
? 'rounded-r-lg bg-red-200 border-l-4 border-l-primary'
|
||||
: 'pl-3 hover:bg-red-200 rounded-lg'
|
||||
"
|
||||
@click="setLink(link.key)"
|
||||
>
|
||||
{{ link.title }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useNavigationStore, type navigationLinkModel } from "@/stores/admin/navigation";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
export default defineComponent({
|
||||
props: {
|
||||
link: {
|
||||
type: Object as PropType<navigationLinkModel>,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(useNavigationStore, ["activeLink"]),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useNavigationStore, ["setLink"]),
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@/stores/contest/viewManager
|
41
src/components/admin/TopLevelLink.vue
Normal file
41
src/components/admin/TopLevelLink.vue
Normal file
|
@ -0,0 +1,41 @@
|
|||
<template>
|
||||
<div
|
||||
v-if="link"
|
||||
class="cursor-pointer w-full flex flex-col md:flex-row items-center md:gap-2 justify-center p-1 md:rounded-full md:px-3 font-medium text-center text-base self-center"
|
||||
:class="
|
||||
activeNavigation == link.key
|
||||
? 'text-primary md:bg-primary md:text-white'
|
||||
: 'text-gray-700 hover:text-accent md:hover:bg-accent md:hover:text-white'
|
||||
"
|
||||
@click="setTopLevel(link.key, disableSubLink)"
|
||||
>
|
||||
{{ link.title }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useNavigationStore, type topLevelNavigationModel } from "@/stores/admin/navigation";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
export default defineComponent({
|
||||
props: {
|
||||
link: {
|
||||
type: Object as PropType<topLevelNavigationModel>,
|
||||
default: null,
|
||||
},
|
||||
disableSubLink: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(useNavigationStore, ["activeNavigation"]),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useNavigationStore, ["setTopLevel"]),
|
||||
},
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue