feat: move timelines to components (#514)
This commit is contained in:
parent
6b7a8baa8e
commit
fef082af13
23 changed files with 123 additions and 68 deletions
7
components/timeline/TimelineBlocks.vue
Normal file
7
components/timeline/TimelineBlocks.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().blocks.iterate()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccountPaginator :paginator="paginator" />
|
||||
</template>
|
7
components/timeline/TimelineBookmarks.vue
Normal file
7
components/timeline/TimelineBookmarks.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().bookmarks.iterate()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TimelinePaginator :paginator="paginator" />
|
||||
</template>
|
7
components/timeline/TimelineConversations.vue
Normal file
7
components/timeline/TimelineConversations.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().conversations.iterate()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConversationPaginator :paginator="paginator" />
|
||||
</template>
|
21
components/timeline/TimelineDomainBlocks.vue
Normal file
21
components/timeline/TimelineDomainBlocks.vue
Normal file
|
@ -0,0 +1,21 @@
|
|||
<script setup lang="ts">
|
||||
const masto = useMasto()
|
||||
const paginator = masto.domainBlocks.iterate()
|
||||
|
||||
const unblock = async (domain: string) => {
|
||||
await masto.domainBlocks.unblock(domain)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CommonPaginator :paginator="paginator">
|
||||
<template #default="{ item }">
|
||||
<CommonDropdownItem class="!cursor-auto">
|
||||
{{ item }}
|
||||
<template #actions>
|
||||
<div i-ri:lock-unlock-line text-primary cursor-pointer @click="unblock(item)" />
|
||||
</template>
|
||||
</CommonDropdownItem>
|
||||
</template>
|
||||
</CommonPaginator>
|
||||
</template>
|
7
components/timeline/TimelineFavourites.vue
Normal file
7
components/timeline/TimelineFavourites.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().favourites.iterate()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TimelinePaginator :paginator="paginator" />
|
||||
</template>
|
12
components/timeline/TimelineHome.vue
Normal file
12
components/timeline/TimelineHome.vue
Normal file
|
@ -0,0 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().timelines.iterateHome()
|
||||
const stream = await useMasto().stream.streamUser()
|
||||
onBeforeUnmount(() => stream.disconnect())
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PublishWidget draft-key="home" border="b base" />
|
||||
<TimelinePaginator v-bind="{ paginator, stream }" context="home" />
|
||||
</div>
|
||||
</template>
|
13
components/timeline/TimelineMentions.vue
Normal file
13
components/timeline/TimelineMentions.vue
Normal file
|
@ -0,0 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
// Default limit is 20 notifications, and servers are normally caped to 30
|
||||
const paginator = useMasto().notifications.iterate({ limit: 30, types: ['mention'] })
|
||||
|
||||
const { clearNotifications } = useNotifications()
|
||||
onActivated(clearNotifications)
|
||||
|
||||
const stream = await useMasto().stream.streamUser()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NotificationPaginator v-bind="{ paginator, stream }" />
|
||||
</template>
|
7
components/timeline/TimelineMutes.vue
Normal file
7
components/timeline/TimelineMutes.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().mutes.iterate()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccountPaginator :paginator="paginator" />
|
||||
</template>
|
13
components/timeline/TimelineNotifications.vue
Normal file
13
components/timeline/TimelineNotifications.vue
Normal file
|
@ -0,0 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
// Default limit is 20 notifications, and servers are normally caped to 30
|
||||
const paginator = useMasto().notifications.iterate({ limit: 30 })
|
||||
|
||||
const { clearNotifications } = useNotifications()
|
||||
onActivated(clearNotifications)
|
||||
|
||||
const stream = await useMasto().stream.streamUser()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NotificationPaginator v-bind="{ paginator, stream }" />
|
||||
</template>
|
7
components/timeline/TimelinePinned.vue
Normal file
7
components/timeline/TimelinePinned.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().accounts.iterateStatuses(currentUser.value!.account.id, { pinned: true })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TimelinePaginator :paginator="paginator" />
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue