feat: use markdown editor in post body

This commit is contained in:
Xyphyn committed 2023-08-04 13:59:48 -07:00
1 parent 270855edf1
commit 2eb491f310
2 files changed
+10 -3

No files matched your search

@@ -10,6 +10,7 @@
import SearchInput from '$lib/components/input/SearchInput.svelte' import SearchInput from '$lib/components/input/SearchInput.svelte'
import { Check, Icon } from 'svelte-hero-icons' import { Check, Icon } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
export let edit = false export let edit = false
@@ -186,7 +187,7 @@
bind:value={data.url} bind:value={data.url}
placeholder="https://notascam.com" placeholder="https://notascam.com"
/> />
<TextArea <MarkdownEditor
rows={6} rows={6}
label="Body" label="Body"
bind:value={data.body} bind:value={data.body}
@@ -17,6 +17,7 @@
export let images: boolean = true export let images: boolean = true
export let value: string = '' export let value: string = ''
export let label: string | undefined = undefined
let textArea: HTMLTextAreaElement let textArea: HTMLTextAreaElement
@@ -90,10 +91,14 @@
</Modal> </Modal>
{/if} {/if}
<div <div>
{#if label}
<div class="block my-1 font-bold text-sm">{label}</div>
{/if}
<div
class="flex flex-col border border-slate-200 dark:border-zinc-800 rounded-md class="flex flex-col border border-slate-200 dark:border-zinc-800 rounded-md
overflow-hidden" overflow-hidden"
> >
<!--Toolbar--> <!--Toolbar-->
<div class="flex flex-row overflow-auto p-1.5 gap-1.5"> <div class="flex flex-row overflow-auto p-1.5 gap-1.5">
<Button <Button
@@ -196,4 +201,5 @@ overflow-hidden"
bind:item={textArea} bind:item={textArea}
{...$$restProps} {...$$restProps}
/> />
</div>
</div> </div>