feat: Add notifications, improve note design

This commit is contained in:
Jesse Wierzbinski 2024-12-02 11:17:25 +01:00
parent c586db3669
commit d32f4d6899
No known key found for this signature in database
7 changed files with 129 additions and 16 deletions

View file

@ -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;

View file

@ -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" />