-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.vue
97 lines (83 loc) · 2.43 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<template>
<div>
<NuxtLayout>
<NuxtPage class="grow overflow-y-auto" />
</NuxtLayout>
<USlideover
v-model="isMobileMenuOpen"
side="left"
>
<UButton
color="gray"
variant="ghost"
icon="i-heroicons-x-mark-20-solid"
class="absolute top-4 right-4 z-20"
square
padded
@click="isMobileMenuOpen = false"
/>
<SiteNavigation />
</USlideover>
<UModal
:model-value="isRestoringSession"
:prevent-close="true"
:ui="{ base: 'p-4 items-center gap-2' }"
>
<span>Restoring session ...</span>
<UProgress animation="carousel" />
</UModal>
<NuxtLoadingIndicator />
<UNotifications />
</div>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useBookStoreApiStore } from '~/stores/book-store-api'
import { useUIStore } from '~/stores/ui'
const { SITE_URL } = useRuntimeConfig().public
const bookStoreApiStore = useBookStoreApiStore()
const { restoreSession } = bookStoreApiStore
const { isRestoringSession } = storeToRefs(bookStoreApiStore)
const uiStore = useUIStore()
const isMobileMenuOpen = computed({
get: () => uiStore.isSiteMenuOpen,
set: value => uiStore.setSiteMenuOpen(value)
})
const route = useRoute()
// NOTE: Close mobile menu on route change
watch(
() => route.fullPath,
() => {
isMobileMenuOpen.value = false
}
)
useHead({
htmlAttrs: {
class: 'h-dvh'
},
bodyAttrs: {
class: 'h-dvh text-gray-700 dark:text-gray-200 dark:bg-gray-900'
},
link: [
{
rel: 'icon',
type: 'image/x-icon',
href: `${SITE_URL}/favicon.ico`
}
]
})
useSeoMeta({
titleTemplate: (titleChunk) => {
return titleChunk ? `${titleChunk} - Liker Land Book Press` : 'Liker Land Book Press'
},
ogTitle: 'Liker Land Book Press',
description: 'Liker Land Web3 Book Press – the future of direct and self-publishing. Empowering authors to create, share, and monetize ebooks seamlessly through decentralized Web3 technology. Start your publishing journey today!',
ogDescription: 'Liker Land Web3 Book Press – the future of direct and self-publishing. Empowering authors to create, share, and monetize ebooks seamlessly through decentralized Web3 technology. Start your publishing journey today!',
ogType: 'website',
ogSiteName: 'Liker Land Book Press',
themeColor: '#28646e'
})
onMounted(async () => {
await restoreSession()
})
</script>