elk/pages/notifications.vue

58 lines
1.4 KiB
Vue
Raw Normal View History

2022-11-16 00:21:54 +03:00
<script setup lang="ts">
2023-01-24 21:52:48 +03:00
import type { CommonRouteTabOption } from '~/components/common/CommonRouteTabs.vue'
2022-11-16 00:21:54 +03:00
definePageMeta({
middleware: 'auth',
})
2022-11-28 17:25:32 +03:00
const { t } = useI18n()
const pwaEnabled = useRuntimeConfig().public.pwaEnabled
2022-11-28 17:25:32 +03:00
2023-01-24 21:52:48 +03:00
const tabs = $computed<CommonRouteTabOption[]>(() => [
2022-11-30 02:25:29 +03:00
{
name: 'all',
to: '/notifications',
display: isHydrated.value ? t('tab.notifications_all') : '',
2022-11-30 02:25:29 +03:00
},
{
name: 'mention',
to: '/notifications/mention',
display: isHydrated.value ? t('tab.notifications_mention') : '',
2022-11-30 02:25:29 +03:00
},
2023-01-24 21:52:48 +03:00
])
2022-11-16 00:21:54 +03:00
</script>
<template>
2022-12-30 21:16:23 +03:00
<MainContent>
2022-11-16 00:21:54 +03:00
<template #title>
2023-01-05 02:17:30 +03:00
<NuxtLink to="/notifications" timeline-title-style flex items-center gap-2 @click="$scrollToTop">
2022-11-29 23:15:53 +03:00
<div i-ri:notification-4-line />
2022-12-27 20:49:15 +03:00
<span>{{ t('nav.notifications') }}</span>
2022-11-29 23:15:53 +03:00
</NuxtLink>
2022-11-16 00:21:54 +03:00
</template>
2022-11-24 09:42:26 +03:00
<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>
2022-11-23 11:08:49 +03:00
<template #header>
<CommonRouteTabs replace :options="tabs" />
2022-11-23 11:08:49 +03:00
</template>
<slot>
<template v-if="pwaEnabled">
<NotificationPreferences />
</template>
<NuxtPage />
</slot>
2022-11-16 00:21:54 +03:00
</MainContent>
</template>