mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Add Enum preference type support
This commit is contained in:
parent
ca824a2a1a
commit
dca7af4b0e
10 changed files with 149 additions and 4 deletions
34
components/timelines/global.vue
Normal file
34
components/timelines/global.vue
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<template>
|
||||
<Timeline type="status" :items="(items as Status[])" :is-loading="isLoading" :has-reached-end="hasReachedEnd"
|
||||
:error="error" :load-next="loadNext" :load-prev="loadPrev" :remove-item="removeItem"
|
||||
:update-item="updateItem" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Status } from "@versia/client/types";
|
||||
import { useGlobalTimeline } from "~/composables/GlobalTimeline";
|
||||
import Timeline from "./timeline.vue";
|
||||
|
||||
const {
|
||||
error,
|
||||
hasReachedEnd,
|
||||
isLoading,
|
||||
items,
|
||||
loadNext,
|
||||
loadPrev,
|
||||
removeItem,
|
||||
updateItem,
|
||||
} = useGlobalTimeline(client.value);
|
||||
|
||||
useListen("note:delete", ({ id }) => {
|
||||
removeItem(id);
|
||||
});
|
||||
|
||||
useListen("note:edit", (updatedNote) => {
|
||||
updateItem(updatedNote);
|
||||
});
|
||||
|
||||
useListen("composer:send", () => {
|
||||
loadPrev();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<template>
|
||||
<div class="timeline rounded">
|
||||
<TransitionGroup name="timeline-item" tag="div"
|
||||
class="timeline-items *:rounded space-y-4 *:border *:border-border/50">
|
||||
class="timeline-items *:rounded space-y-4 *:border">
|
||||
<TimelineItem :type="type" v-for="item in items" :key="item.id" :item="item" @update="updateItem"
|
||||
@delete="removeItem" />
|
||||
</TransitionGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue