forked from elk-zone/elk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifications.vue
55 lines (48 loc) · 1.27 KB
/
notifications.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
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
const { t } = useI18n()
const pwaEnabled = useRuntimeConfig().public.pwaEnabled
const tabs = $computed(() => [
{
name: 'all',
to: '/notifications',
display: isHydrated.value ? t('tab.notifications_all') : '',
},
{
name: 'mention',
to: '/notifications/mention',
display: isHydrated.value ? t('tab.notifications_mention') : '',
},
] as const)
</script>
<template>
<MainContent>
<template #title>
<NuxtLink to="/notifications" timeline-title-style flex items-center gap-2 @click="$scrollToTop">
<div i-ri:notification-4-line />
<span>{{ t('nav.notifications') }}</span>
</NuxtLink>
</template>
<template #actions>
<NuxtLink
flex rounded-4 p1
hover:bg-active cursor-pointer transition-100
:title="t('settings.notifications.show_btn')"
to="/settings/notifications"
>
<span aria-hidden="true" i-ri:notification-badge-line />
</NuxtLink>
</template>
<template #header>
<CommonRouteTabs replace :options="tabs" />
</template>
<slot>
<template v-if="pwaEnabled">
<NotificationPreferences />
</template>
<NuxtPage />
</slot>
</MainContent>
</template>