misc: tweak line height
This commit is contained in:
1 parent
fcb21a0e35
commit
a362241a72
3 files changed
+34
-9
No files matched your search
@@ -71,6 +71,7 @@
|
|||||||
postId={node.comment_view.comment.id}
|
postId={node.comment_view.comment.id}
|
||||||
bind:value={newComment}
|
bind:value={newComment}
|
||||||
actions={false}
|
actions={false}
|
||||||
|
preview={true}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -142,7 +143,7 @@
|
|||||||
class="flex flex-col whitespace-pre-wrap
|
class="flex flex-col whitespace-pre-wrap
|
||||||
max-w-full gap-1"
|
max-w-full gap-1"
|
||||||
>
|
>
|
||||||
<div class="max-w-full mt-0.5 break-words text-sm leading-[22px]">
|
<div class="max-w-full mt-0.5 break-words text-sm">
|
||||||
<Markdown source={node.comment_view.comment.content} />
|
<Markdown source={node.comment_view.comment.content} />
|
||||||
</div>
|
</div>
|
||||||
{#if actions}
|
{#if actions}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { ToastType, addToast } from '$lib/components/ui/toasts/toasts.js'
|
import { ToastType, addToast } from '$lib/components/ui/toasts/toasts.js'
|
||||||
import TextArea from '$lib/components/input/TextArea.svelte'
|
import TextArea from '$lib/components/input/TextArea.svelte'
|
||||||
|
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||||
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
|
|
||||||
export let postId: number
|
export let postId: number
|
||||||
export let parentId: number | undefined = undefined
|
export let parentId: number | undefined = undefined
|
||||||
@@ -16,7 +18,11 @@
|
|||||||
export let value = ''
|
export let value = ''
|
||||||
export let actions = true
|
export let actions = true
|
||||||
|
|
||||||
|
let previewAction = true
|
||||||
|
export { previewAction as preview }
|
||||||
|
|
||||||
let loading = false
|
let loading = false
|
||||||
|
let preview = false
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
if (!$user || !$authData || value == '') return
|
if (!$user || !$authData || value == '') return
|
||||||
@@ -52,6 +58,14 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2 relative">
|
<div class="flex flex-col gap-2 relative">
|
||||||
|
{#if preview}
|
||||||
|
<div
|
||||||
|
class="bg-slate-100 dark:bg-zinc-900 px-3 py-2.5 h-[102px] border
|
||||||
|
border-slate-300 dark:border-zinc-700 rounded-md overflow-auto text-sm"
|
||||||
|
>
|
||||||
|
<Markdown source={value} />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
<TextArea
|
<TextArea
|
||||||
rows={4}
|
rows={4}
|
||||||
placeholder={locked ? 'This post is locked.' : 'What are you thinking?'}
|
placeholder={locked ? 'This post is locked.' : 'What are you thinking?'}
|
||||||
@@ -59,19 +73,29 @@
|
|||||||
bind:value
|
bind:value
|
||||||
disabled={locked}
|
disabled={locked}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
|
{#if actions || previewAction}
|
||||||
|
<div class="flex flex-row items-center justify-between">
|
||||||
|
{#if previewAction}
|
||||||
|
<MultiSelect
|
||||||
|
options={[false, true]}
|
||||||
|
optionNames={['Edit', 'Preview']}
|
||||||
|
bind:selected={preview}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{#if actions}
|
{#if actions}
|
||||||
<div class="sm:ml-auto sm:w-28">
|
|
||||||
<Button
|
<Button
|
||||||
large
|
large
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
color="primary"
|
color="primary"
|
||||||
size="lg"
|
size="lg"
|
||||||
class="w-full"
|
class="sm:ml-auto w-28"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={locked || loading}
|
disabled={locked || loading}
|
||||||
>
|
>
|
||||||
Submit
|
Submit
|
||||||
</Button>
|
</Button>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
export let source: string = ''
|
export let source: string = ''
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="break-words flex flex-col markdown gap-2 leading-[22px]">
|
<div class="break-words flex flex-col markdown gap-2 leading-[1.4]">
|
||||||
{@html md.render(source)}
|
{@html md.render(source)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -44,19 +44,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(ul > *) {
|
.markdown :global(ul > *) {
|
||||||
@apply leading-[22px];
|
@apply leading-[20px];
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(ol > *) {
|
.markdown :global(ol > *) {
|
||||||
@apply leading-[22px];
|
@apply leading-[20px];
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(li) {
|
.markdown :global(li) {
|
||||||
@apply m-0 leading-[22px] !important;
|
@apply m-0 leading-[1.4] !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(li > *) {
|
.markdown :global(li > *) {
|
||||||
@apply m-0 leading-[22px] !important;
|
@apply m-0 leading-[1.4] !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(blockquote) {
|
.markdown :global(blockquote) {
|
||||||
@@ -64,6 +64,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(p) {
|
.markdown :global(p) {
|
||||||
@apply leading-[22px];
|
@apply leading-[1.4];
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user