add tab favorites
This commit is contained in:
parent
e67084c118
commit
eaa31c4bea
|
|
@ -2,6 +2,7 @@
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import type { NavigationMenuItem } from '@nuxt/ui'
|
import type { NavigationMenuItem } from '@nuxt/ui'
|
||||||
|
import { useFavoritesStore } from '~/stores/favorites'
|
||||||
|
|
||||||
const { locale, locales, setLocale } = useI18n()
|
const { locale, locales, setLocale } = useI18n()
|
||||||
|
|
||||||
|
|
@ -10,6 +11,9 @@ const t = $i18n.t;
|
||||||
|
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
|
|
||||||
|
const favorites = useFavoritesStore()
|
||||||
|
const { total: favTotal } = storeToRefs(favorites)
|
||||||
|
|
||||||
const links = [[{
|
const links = [[{
|
||||||
label: t('nav.bible_studies'),
|
label: t('nav.bible_studies'),
|
||||||
icon: 'ph:books',
|
icon: 'ph:books',
|
||||||
|
|
@ -41,6 +45,12 @@ const links = [[{
|
||||||
icon: 'ph:chalkboard-teacher',
|
icon: 'ph:chalkboard-teacher',
|
||||||
to: '/ebn',
|
to: '/ebn',
|
||||||
onSelect: () => { open.value = false }
|
onSelect: () => { open.value = false }
|
||||||
|
}, {
|
||||||
|
label: 'Mi lista',
|
||||||
|
icon: 'i-lucide-bookmark',
|
||||||
|
to: '/favoritos',
|
||||||
|
badge: favTotal.value > 0 ? String(favTotal.value) : undefined,
|
||||||
|
onSelect: () => { open.value = false }
|
||||||
}]] satisfies NavigationMenuItem[][]
|
}]] satisfies NavigationMenuItem[][]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -56,8 +66,8 @@ const links = [[{
|
||||||
class="bg-elevated/25 bg-gradient-to-tr from-blue-100 to-white"
|
class="bg-elevated/25 bg-gradient-to-tr from-blue-100 to-white"
|
||||||
:ui="{ footer: 'lg:border-t lg:border-default' }"
|
:ui="{ footer: 'lg:border-t lg:border-default' }"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header="{ collapsed }">
|
||||||
<div class="mt-2 flex justify-center">
|
<div v-if="!collapsed" class="mt-2 flex justify-center">
|
||||||
<img src="/logo.svg" class="w-full" alt="Buscador - La Gran Carpa Catedral" />
|
<img src="/logo.svg" class="w-full" alt="Buscador - La Gran Carpa Catedral" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue