mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 16:50:47 +08:00
Allow preview for empty body in ExtendedTextarea
Instead of disabling the preview feature when the body is empty, we show `Nothing to preview`
This commit is contained in:
@@ -231,7 +231,11 @@
|
||||
<div class="comment-section" aria-label="extended-textarea" class:inline>
|
||||
{#if preview}
|
||||
<div class="preview">
|
||||
<Markdown {rid} breaks content={body} />
|
||||
{#if body.trim().length === 0}
|
||||
<span class="txt-missing">Nothing to preview.</span>
|
||||
{:else}
|
||||
<Markdown {rid} breaks content={body} />
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<Textarea
|
||||
@@ -277,10 +281,7 @@
|
||||
<Icon name="attachment" />
|
||||
Attach
|
||||
</OutlineButton>
|
||||
<OutlineButton
|
||||
variant="ghost"
|
||||
disabled={body.trim() === ""}
|
||||
onclick={() => (preview = !preview)}>
|
||||
<OutlineButton variant="ghost" onclick={() => (preview = !preview)}>
|
||||
<Icon name={preview ? "pen" : "eye"} />
|
||||
{preview ? "Edit" : "Preview"}
|
||||
</OutlineButton>
|
||||
|
||||
@@ -101,7 +101,11 @@
|
||||
<div class="content">
|
||||
{#if preview}
|
||||
<div class="title">
|
||||
<InlineTitle content={title} fontSize="medium" />
|
||||
{#if title.trim().length === 0}
|
||||
<span class="txt-missing">No title</span>
|
||||
{:else}
|
||||
<InlineTitle content={title} fontSize="medium" />
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<div style:margin-bottom="1rem">
|
||||
|
||||
Reference in New Issue
Block a user