ff-admin/src/components/Header.vue

38 lines
1.4 KiB
Vue
Raw Normal View History

2024-08-23 14:42:32 +02:00
<template>
2024-10-08 10:50:46 +02:00
<header class="flex flex-row h-16 min-h-16 justify-between p-3 md:px-5 bg-white shadow-sm">
<RouterLink to="/" class="flex flex-row gap-2 align-bottom w-fit h-full">
2024-08-23 14:42:32 +02:00
<img src="/FFW-Logo.svg" alt="LOGO" class="h-full w-auto" />
<h1 v-if="false" class="font-bold text-3xl w-fit whitespace-nowrap">Mitgliederverwaltung</h1>
</RouterLink>
<div class="flex flex-row gap-2 items-center">
2024-11-20 10:02:25 +01:00
<div v-if="authCheck" class="hidden md:flex flex-row gap-2 h-full align-middle">
<TopLevelLink v-if="routeName.includes('admin')" v-for="item in topLevel" :key="item.key" :link="item" />
<TopLevelLink v-else :link="{ key: 'club', title: 'Zur Verwaltung' }" :disable-sub-link="true" />
2024-08-23 14:42:32 +02:00
</div>
<UserMenu v-if="authCheck" />
</div>
</header>
</template>
<script setup lang="ts">
import { RouterLink } from "vue-router";
import { mapState } from "pinia";
2024-09-17 16:44:02 +02:00
import { useAuthStore } from "@/stores/auth";
import { useNavigationStore } from "@/stores/admin/navigation";
2024-08-23 14:42:32 +02:00
import TopLevelLink from "./admin/TopLevelLink.vue";
import UserMenu from "./UserMenu.vue";
</script>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
computed: {
...mapState(useAuthStore, ["authCheck"]),
...mapState(useNavigationStore, ["topLevel"]),
routeName() {
2024-09-01 19:19:48 +02:00
return typeof this.$route.name == "string" ? this.$route.name : "";
2024-08-23 14:42:32 +02:00
},
},
});
</script>