From 2902f30327dc093478e07d2b9c3c0c08232d9902 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Wed, 6 Sep 2023 18:09:03 -0700 Subject: [PATCH] feat: use notification date, close #59 --- src/lib/components/lemmy/post/PostMeta.svelte | 6 ++++-- src/routes/inbox/InboxItem.svelte | 21 ++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/lib/components/lemmy/post/PostMeta.svelte b/src/lib/components/lemmy/post/PostMeta.svelte index 83623b57..ebb7878d 100644 --- a/src/lib/components/lemmy/post/PostMeta.svelte +++ b/src/lib/components/lemmy/post/PostMeta.svelte @@ -18,7 +18,7 @@ export let community: Community | undefined = undefined export let user: Person | undefined = undefined - export let published: Date + export let published: Date | undefined = undefined export let title: string | undefined = undefined export let id: number | undefined = undefined @@ -56,7 +56,9 @@ {/if} - + {#if published} + + {/if} {#if upvotes != undefined && downvotes != undefined} • diff --git a/src/routes/inbox/InboxItem.svelte b/src/routes/inbox/InboxItem.svelte index 025fc9af..db8897a5 100644 --- a/src/routes/inbox/InboxItem.svelte +++ b/src/routes/inbox/InboxItem.svelte @@ -17,6 +17,8 @@ import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import { Button } from 'mono-svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' + import RelativeDate from '$lib/components/util/RelativeDate.svelte' + import { publishedToDate } from '$lib/components/util/date.js' export let item: CommentReplyView | PersonMentionView | PrivateMessageView export let read: boolean @@ -27,6 +29,10 @@ return 'private_message' in item } + const isCommentReply = ( + item: CommentReplyView | PersonMentionView | PrivateMessageView + ): item is CommentReplyView => 'comment_reply' in item + let replying = false let reply = '' let loading = false @@ -91,11 +97,16 @@ {#if !isPrivateMessage(item)} - +
+ + {#if isCommentReply(item)} + + {:else} + + {/if} + + +