Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Allow preview for empty body in ExtendedTextarea
Sebastian Martinez committed 1 year ago
commit 01416e8aa55116cf52e30167cdf2fbee64b5663e
parent 684a5df136e0ea7e00ef17c622f9e76617406d4b
2 files changed +11 -6
modified src/components/ExtendedTextarea.svelte
@@ -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>
modified src/views/repo/CreateIssue.svelte
@@ -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">