added theme toggle,

fixed create entityies in API
This commit is contained in:
2026-02-14 08:01:07 +01:00
parent 9b2f2c4e91
commit 276cc21c5a
13 changed files with 141 additions and 46 deletions

View File

@ -0,0 +1,32 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons'
import { useThemeStore } from '@/stores/theme'
const props = withDefaults(defineProps<{
showLabel?: boolean
}>(), {
showLabel: true,
})
const { t } = useI18n()
const themeStore = useThemeStore()
themeStore.initialize()
const icon = computed(() => (themeStore.isDarkMode ? faMoon : faSun))
const themeLabel = computed(() => t(themeStore.currentThemeLabelKey))
</script>
<template>
<button
type="button"
class="theme-btn"
:aria-label="t('theme.toggle')"
@click="themeStore.toggle"
>
<font-awesome-icon :icon="icon" />
<span v-if="props.showLabel">{{ themeLabel }}</span>
</button>
</template>

View File

@ -2,6 +2,7 @@
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import ThemeToggle from '@/components/common/ThemeToggle.vue'
import { useAuthStore } from '@/stores/auth'
const route = useRoute()
@ -33,8 +34,11 @@ const title = computed(() => {
<div>
<h1>{{ title }}</h1>
</div>
<div class="app-topbar__user" v-if="auth.userEmail">
{{ auth.userEmail }}
<div class="app-topbar__actions">
<ThemeToggle :show-label="false" />
<div class="app-topbar__user" v-if="auth.userEmail">
{{ auth.userEmail }}
</div>
</div>
</header>
</template>