ff-admin/src/components/Header.vue

48 lines
1.7 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-12-05 14:31:21 +01:00
<img src="/Logo.png" alt="LOGO" class="h-full w-auto" />
2025-01-11 14:45:48 +01:00
<h1 v-if="false" class="font-bold text-3xl w-fit whitespace-nowrap">{{config.app_name_overwrite || "FF Admin"}}</h1>
2024-08-23 14:42:32 +02:00
</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">
2024-11-23 14:25:41 +01:00
<TopLevelLink
v-if="routeName == 'admin' || routeName.includes('admin-')"
v-for="item in topLevel"
:key="item.key"
:link="item"
/>
<TopLevelLink
2025-01-04 19:18:14 +01:00
v-else-if="routeName == 'account' || routeName.includes('account-') || routeName == 'docs' || routeName.includes('docs-')"
2024-11-27 17:06:39 +01:00
:link="{ key: 'club', title: 'Zur Verwaltung', levelDefault: '' }"
2024-11-23 14:25:41 +01:00
: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";
import { config } from "@/config"
2024-08-23 14:42:32 +02:00
</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>