mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 11:39:16 +01:00
refactor: ♻️ Reimplement Notes
This commit is contained in:
parent
9ced2c98e4
commit
d29f181000
21 changed files with 335 additions and 30 deletions
|
|
@ -1,11 +1,12 @@
|
|||
<template>
|
||||
<component :is="itemComponent" :element="item" @update="$emit('update', $event)"
|
||||
<component :is="itemComponent" :note="item" @update="$emit('update', $event)"
|
||||
@delete="$emit('delete', item?.id)" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Notification, Status } from "@versia/client/types";
|
||||
import { computed } from "vue";
|
||||
import NewNoteItem from "../notes/note.vue";
|
||||
import NoteItem from "../social-elements/notes/note.vue";
|
||||
import NotificationItem from "../social-elements/notifications/notif.vue";
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ const props = defineProps<{
|
|||
|
||||
const itemComponent = computed(() => {
|
||||
if (props.type === "status") {
|
||||
return NoteItem;
|
||||
return NewNoteItem;
|
||||
}
|
||||
if (props.type === "notification") {
|
||||
return NotificationItem;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<!-- Timeline.vue -->
|
||||
<template>
|
||||
<div class="timeline rounded overflow-hidden">
|
||||
<TransitionGroup name="timeline-item" tag="div" class="timeline-items">
|
||||
<div class="timeline rounded overflow-hidden ring-1 ring-ring/15">
|
||||
<TransitionGroup name="timeline-item" tag="div" class="timeline-items *:!border-b *:last:border-0">
|
||||
<TimelineItem :type="type" v-for="item in items" :key="item.id" :item="item" @update="updateItem"
|
||||
@delete="removeItem" />
|
||||
</TransitionGroup>
|
||||
|
||||
<TimelineItem v-if="isLoading" :type="type" v-for="_ in 5" />
|
||||
<!-- <TimelineItem v-if="isLoading" :type="type" v-for="_ in 5" /> -->
|
||||
|
||||
<div v-if="error" class="timeline-error">
|
||||
{{ error.message }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue