2022-11-16 00:21:54 +03:00
|
|
|
<script setup lang="ts">
|
|
|
|
definePageMeta({
|
|
|
|
middleware: 'auth',
|
|
|
|
})
|
|
|
|
|
2022-11-28 17:25:32 +03:00
|
|
|
const { t } = useI18n()
|
2022-12-18 02:29:16 +03:00
|
|
|
const showSettings = ref(false)
|
|
|
|
const pwaEnabled = useRuntimeConfig().public.pwaEnabled
|
2022-11-28 17:25:32 +03:00
|
|
|
|
2022-11-30 02:25:29 +03:00
|
|
|
const tabs = $computed(() => [
|
|
|
|
{
|
|
|
|
name: 'all',
|
2022-12-13 16:50:42 +03:00
|
|
|
to: '/notifications',
|
2022-11-30 02:25:29 +03:00
|
|
|
display: t('tab.notifications_all'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'mention',
|
2022-12-13 16:50:42 +03:00
|
|
|
to: '/notifications/mention',
|
2022-11-30 02:25:29 +03:00
|
|
|
display: t('tab.notifications_mention'),
|
|
|
|
},
|
|
|
|
] as const)
|
2022-12-18 02:29:16 +03:00
|
|
|
|
|
|
|
onActivated(() => {
|
|
|
|
showSettings.value = false
|
|
|
|
})
|
2022-11-16 00:21:54 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MainContent>
|
|
|
|
<template #title>
|
2022-11-29 23:15:53 +03:00
|
|
|
<NuxtLink to="/notifications" text-lg font-bold flex items-center gap-2 @click="$scrollToTop">
|
|
|
|
<div i-ri:notification-4-line />
|
|
|
|
<span>{{ t('nav_side.notifications') }}</span>
|
|
|
|
</NuxtLink>
|
2022-11-16 00:21:54 +03:00
|
|
|
</template>
|
2022-11-24 09:42:26 +03:00
|
|
|
|
2022-12-18 02:29:16 +03:00
|
|
|
<template v-if="pwaEnabled" #actions>
|
|
|
|
<button
|
|
|
|
flex rounded-4 p1
|
|
|
|
hover:bg-active cursor-pointer transition-100
|
|
|
|
:title="$t(showSettings ? 'notification.settings.close_btn' : 'notification.settings.show_btn')"
|
|
|
|
@click="showSettings = !showSettings"
|
|
|
|
>
|
2022-12-19 23:31:12 +03:00
|
|
|
<span aria-hidden="true" w-1.75em h-1.75em :class="showSettings ? 'i-ri:close-line' : 'i-ri:settings-line'" />
|
2022-12-18 02:29:16 +03:00
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
|
2022-11-23 11:08:49 +03:00
|
|
|
<template #header>
|
2022-12-13 16:50:42 +03:00
|
|
|
<CommonRouteTabs replace :options="tabs" />
|
2022-11-23 11:08:49 +03:00
|
|
|
</template>
|
2022-12-18 02:29:16 +03:00
|
|
|
|
|
|
|
<slot>
|
|
|
|
<template v-if="pwaEnabled">
|
|
|
|
<NotificationPreferences :show="showSettings" />
|
|
|
|
</template>
|
2022-12-26 08:39:18 +03:00
|
|
|
|
2022-12-18 02:29:16 +03:00
|
|
|
<NuxtPage />
|
|
|
|
</slot>
|
2022-11-16 00:21:54 +03:00
|
|
|
</MainContent>
|
|
|
|
</template>
|