elk/pages/notifications.vue

56 lines
1.2 KiB
Vue
Raw Normal View History

2022-11-15 21:21:54 +00:00
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
2023-01-09 20:20:26 +00:00
const { $t } = useFluent()
const pwaEnabled = useRuntimeConfig().public.pwaEnabled
2022-11-28 14:25:32 +00:00
2022-11-29 23:25:29 +00:00
const tabs = $computed(() => [
{
name: 'all',
to: '/notifications',
2023-01-09 20:20:26 +00:00
display: $t('tab_notifications_all'),
2022-11-29 23:25:29 +00:00
},
{
name: 'mention',
to: '/notifications/mention',
2023-01-09 20:20:26 +00:00
display: $t('tab_notifications_mention'),
2022-11-29 23:25:29 +00:00
},
] as const)
2022-11-15 21:21:54 +00:00
</script>
<template>
2022-12-30 18:16:23 +00:00
<MainContent>
2022-11-15 21:21:54 +00:00
<template #title>
2023-01-04 23:17:30 +00:00
<NuxtLink to="/notifications" timeline-title-style flex items-center gap-2 @click="$scrollToTop">
2022-11-29 20:15:53 +00:00
<div i-ri:notification-4-line />
2023-01-09 20:20:26 +00:00
<span>{{ $t('nav_notifications') }}</span>
2022-11-29 20:15:53 +00:00
</NuxtLink>
2022-11-15 21:21:54 +00:00
</template>
2022-11-24 06:42:26 +00:00
<template #actions>
<NuxtLink
flex rounded-4 p1
hover:bg-active cursor-pointer transition-100
2023-01-09 20:20:26 +00:00
:title="$t('settings_notifications_show_btn')"
to="/settings/notifications"
>
<span aria-hidden="true" i-ri:notification-badge-line />
</NuxtLink>
</template>
2022-11-23 08:08:49 +00:00
<template #header>
<CommonRouteTabs replace :options="tabs" />
2022-11-23 08:08:49 +00:00
</template>
<slot>
<template v-if="pwaEnabled">
<NotificationPreferences />
</template>
<NuxtPage />
</slot>
2022-11-15 21:21:54 +00:00
</MainContent>
</template>