feat: posts and mentions in profile (#17)
This commit is contained in:
parent
2442c80bfb
commit
5d5cdebb56
3 changed files with 38 additions and 13 deletions
|
@ -1,16 +1,15 @@
|
|||
<script setup lang="ts">
|
||||
import type { FetchNotificationsParams } from 'masto'
|
||||
definePageMeta({
|
||||
middleware: 'auth',
|
||||
})
|
||||
|
||||
const masto = await useMasto()
|
||||
|
||||
const tabNames = ['all', 'mentions'] as const
|
||||
const tab = $(useLocalStorage<typeof tabNames[number]>('nuxtodon-notifications-tab', 'all'))
|
||||
const tabNames = ['All', 'Mentions'] as const
|
||||
const tab = $(useLocalStorage<typeof tabNames[number]>('nuxtodon-notifications-tab', 'All'))
|
||||
|
||||
const paginator = $computed(() => {
|
||||
return masto.notifications.getIterator(tab === 'all' ? undefined : { types: ['mention'] })
|
||||
return masto.notifications.getIterator(tab === 'All' ? undefined : { types: ['mention'] })
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -23,13 +22,7 @@ const paginator = $computed(() => {
|
|||
<div color-gray i-ri:equalizer-fill mr-1 h-6 />
|
||||
</template>
|
||||
<slot>
|
||||
<div flex w-full>
|
||||
<template v-for="type in tabNames" :key="type">
|
||||
<input
|
||||
:id="`tab-${type}`" v-model="tab" :value="type" type="radio" name="tabs" display="none"
|
||||
><label flex w-full justify-center h-8 cursor-pointer :for="`tab-${type}`" :class="tab === type ? 'color-primary' : 'hover:color-purple'" tabindex="1" @keypress.enter="tab = type">{{ type }}</label>
|
||||
</template>
|
||||
</div>
|
||||
<CommonTabs v-model="tab" :options="tabNames" />
|
||||
<NotificationPaginator :key="tab" :paginator="paginator" />
|
||||
</slot>
|
||||
</MainContent>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue