From 71411dadf1c0715bab447298e95d01bca73f57e5 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 18 Jun 2025 10:52:41 -0700 Subject: [PATCH] feat: add comment reply preview --- .../components/lemmy/comment/Comment.svelte | 32 +++++++++++++++---- .../lemmy/comment/CommentItem.svelte | 3 ++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte index e2f9aef0..0f6ff6f5 100644 --- a/src/lib/components/lemmy/comment/Comment.svelte +++ b/src/lib/components/lemmy/comment/Comment.svelte @@ -8,12 +8,13 @@ import { t } from '$lib/i18n/translations' import { getClient } from '$lib/lemmy.svelte.js' import { errorMessage } from '$lib/lemmy/error' - import { Button, Modal, toast } from 'mono-svelte' + import { Button, Material, Modal, toast } from 'mono-svelte' import { Bookmark, Icon, Microphone, Pencil, Trash } from 'svelte-hero-icons' import type { ClassValue } from 'svelte/elements' import ShieldIcon from '../moderation/ShieldIcon.svelte' import CommentForm from './CommentForm.svelte' import type { CommentNodeI } from './comments.svelte' + import CommentItem from './CommentItem.svelte' interface Props { node: CommentNodeI @@ -95,8 +96,27 @@ } > {#snippet customTitle()} - {replying ? $t('comment.reply') : $t('form.edit')} +
{replying ? $t('comment.reply') : $t('form.edit')}
{/snippet} + {#if replying} + + + + +
+
+ {/if}
{ e.preventDefault() @@ -210,11 +230,11 @@ {/if} -
-
+
+
@@ -71,6 +73,7 @@ node={{ children: [], comment_view: comment, depth: 1, expanded: true }} replying={false} {meta} + {actions} {...rest} class={commentClass} />