Optimize message editor
This commit is contained in:
parent
7b79b0914a
commit
e94764b865
2 changed files with 10 additions and 10 deletions
|
|
@ -357,7 +357,7 @@
|
||||||
onblur={onTextareaBlur}
|
onblur={onTextareaBlur}
|
||||||
aria-autocomplete="list"
|
aria-autocomplete="list"
|
||||||
aria-controls={mentionOpen ? "mention-listbox" : undefined}
|
aria-controls={mentionOpen ? "mention-listbox" : undefined}
|
||||||
class="w-full rounded-t border border-gray-200 px-3 py-2 focus:outline-none focus:ring-1 focus:ring-brand disabled:opacity-50 resize-none {minHeightClass}"
|
class="block w-full rounded-t border border-gray-200 px-3 py-2 focus:outline-none focus:ring-1 focus:ring-brand disabled:opacity-50 resize-y {minHeightClass}"
|
||||||
></textarea>
|
></textarea>
|
||||||
{#if mentionOpen}
|
{#if mentionOpen}
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,11 @@
|
||||||
const source = (selectedText ?? post.content).trim();
|
const source = (selectedText ?? post.content).trim();
|
||||||
if (!source) return;
|
if (!source) return;
|
||||||
const block = formatQuoteBlock(source, ref);
|
const block = formatQuoteBlock(source, ref);
|
||||||
const sep = replyContent.length > 0 && !replyContent.endsWith("\n\n")
|
const sep =
|
||||||
? replyContent.endsWith("\n") ? "\n" : "\n\n"
|
replyContent.length > 0 && !replyContent.endsWith("\n\n")
|
||||||
|
? replyContent.endsWith("\n")
|
||||||
|
? "\n"
|
||||||
|
: "\n\n"
|
||||||
: "";
|
: "";
|
||||||
replyContent = replyContent + sep + block + "\n\n";
|
replyContent = replyContent + sep + block + "\n\n";
|
||||||
await tick();
|
await tick();
|
||||||
|
|
@ -228,11 +231,7 @@
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div data-quote-post-index={index} id="post-{p.id}" class="scroll-mt-32">
|
<div data-quote-post-index={index} id="post-{p.id}" class="scroll-mt-32">
|
||||||
<PostContent
|
<PostContent content={p.content} {profiles} {threadEventAuthors} />
|
||||||
content={p.content}
|
|
||||||
{profiles}
|
|
||||||
{threadEventAuthors}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-between mt-3">
|
<div class="flex items-center justify-between mt-3">
|
||||||
<Reactions reactions={[]} zaps={0} />
|
<Reactions reactions={[]} zaps={0} />
|
||||||
|
|
@ -303,7 +302,8 @@
|
||||||
bind:this={editorEl}
|
bind:this={editorEl}
|
||||||
bind:value={replyContent}
|
bind:value={replyContent}
|
||||||
disabled={replying}
|
disabled={replying}
|
||||||
rows={4}
|
rows={8}
|
||||||
|
minHeightClass="min-h-[12rem]"
|
||||||
placeholder="Write a reply..."
|
placeholder="Write a reply..."
|
||||||
contextPubkeys={allPosts.map((p) => p.pubkey)}
|
contextPubkeys={allPosts.map((p) => p.pubkey)}
|
||||||
{threadEventAuthors}
|
{threadEventAuthors}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue