mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Add notifications, improve note design
This commit is contained in:
parent
c586db3669
commit
d32f4d6899
7 changed files with 129 additions and 16 deletions
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<component :is="itemComponent" :note="item" @update="$emit('update', $event)"
|
||||
<component :is="itemComponent" :note="type === 'status' ? item : undefined" :notification="type === 'notification' ? item : undefined" @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 NotificationItem from "../social-elements/notifications/notif.vue";
|
||||
import Note from "../notes/note.vue";
|
||||
import NotificationItem from "../notifications/notification.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
item?: Status | Notification;
|
||||
|
|
@ -16,7 +16,7 @@ const props = defineProps<{
|
|||
|
||||
const itemComponent = computed(() => {
|
||||
if (props.type === "status") {
|
||||
return NewNoteItem;
|
||||
return Note;
|
||||
}
|
||||
if (props.type === "notification") {
|
||||
return NotificationItem;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!-- Timeline.vue -->
|
||||
<template>
|
||||
<div class="timeline rounded overflow-hidden">
|
||||
<div class="timeline rounded">
|
||||
<TransitionGroup name="timeline-item" tag="div" class="timeline-items *:rounded space-y-4 *:border *:border-border/50">
|
||||
<TimelineItem :type="type" v-for="item in items" :key="item.id" :item="item" @update="updateItem"
|
||||
@delete="removeItem" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue