diff --git a/frontend/src/App.vue b/frontend/src/App.vue index b76d5f6..4207998 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -3,6 +3,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import AppShell from './components/AppShell.vue'; +import { iconAdmin, iconChecklist, iconHabitat, iconItem, iconPokemon, iconRecipe } from './icons'; import { getCurrentLocale, onLocaleChange, setCurrentLocale } from './i18n'; import { api, getAuthToken, onAuthTokenChange, setAuthToken, type AuthUser, type Language } from './services/api'; @@ -18,12 +19,12 @@ let removeAuthListener: (() => void) | null = null; let removeLocaleListener: (() => void) | null = null; const navItems = computed(() => [ - { label: t('nav.pokemon'), to: '/pokemon' }, - { label: t('nav.habitats'), to: '/habitats' }, - { label: t('nav.items'), to: '/items' }, - { label: t('nav.recipes'), to: '/recipes' }, - { label: t('nav.checklist'), to: '/checklist' }, - { label: t('nav.admin'), to: '/admin' } + { label: t('nav.pokemon'), to: '/pokemon', icon: iconPokemon }, + { label: t('nav.habitats'), to: '/habitats', icon: iconHabitat }, + { label: t('nav.items'), to: '/items', icon: iconItem }, + { label: t('nav.recipes'), to: '/recipes', icon: iconRecipe }, + { label: t('nav.checklist'), to: '/checklist', icon: iconChecklist }, + { label: t('nav.admin'), to: '/admin', icon: iconAdmin } ]); async function loadCurrentUser() { diff --git a/frontend/src/components/AppShell.vue b/frontend/src/components/AppShell.vue index 43a46ee..9df9c26 100644 --- a/frontend/src/components/AppShell.vue +++ b/frontend/src/components/AppShell.vue @@ -2,6 +2,7 @@ import { Icon } from '@iconify/vue'; import { onBeforeUnmount, onMounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; +import { iconLogin, iconLogout, iconRegister, iconTranslate, type AppIcon } from '../icons'; import type { AuthUser, Language } from '../services/api'; import PokeBallMark from './PokeBallMark.vue'; @@ -9,7 +10,7 @@ defineProps<{ currentUser: AuthUser | null; languages: Language[]; locale: string; - navItems: Array<{ label: string; to: string }>; + navItems: Array<{ label: string; to: string; icon?: AppIcon }>; }>(); const emit = defineEmits<{ @@ -18,11 +19,6 @@ const emit = defineEmits<{ }>(); const { t } = useI18n(); -const translateIcon = { - width: 24, - height: 24, - body: '' -}; const languageMenu = ref(null); const languageMenuButton = ref(null); const languageMenuOpen = ref(false); @@ -78,6 +74,7 @@ onBeforeUnmount(() => { @@ -93,7 +90,7 @@ onBeforeUnmount(() => { aria-haspopup="menu" @click="toggleLanguageMenu" > -