misc: Increase post body padding
This commit is contained in:
1 parent
fa20d7a6a8
commit
3d19318355
3 files changed
+13
-12
No files matched your search
@@ -8,14 +8,14 @@
|
|||||||
Plus,
|
Plus,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import type { CommentNodeI } from './comments'
|
import { insertCommentIntoTree, type CommentNodeI } from './comments'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import CommentForm from './CommentForm.svelte'
|
import CommentForm from './CommentForm.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte'
|
import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher, getContext } from 'svelte'
|
||||||
import type { CommentView } from 'lemmy-js-client'
|
import type { CommentView } from 'lemmy-js-client'
|
||||||
import Modal from '$lib/components/ui/modal/Modal.svelte'
|
import Modal from '$lib/components/ui/modal/Modal.svelte'
|
||||||
import { authData, getClient } from '$lib/lemmy.js'
|
import { authData, getClient } from '$lib/lemmy.js'
|
||||||
@@ -163,14 +163,11 @@
|
|||||||
{postId}
|
{postId}
|
||||||
parentId={node.comment_view.comment.id}
|
parentId={node.comment_view.comment.id}
|
||||||
on:comment={(e) => {
|
on:comment={(e) => {
|
||||||
node.children = [
|
insertCommentIntoTree(
|
||||||
{
|
getContext('comments:tree'),
|
||||||
children: [],
|
e.detail.comment_view,
|
||||||
depth: node.depth + 1,
|
false
|
||||||
comment_view: e.detail.comment_view,
|
)
|
||||||
},
|
|
||||||
...node.children,
|
|
||||||
]
|
|
||||||
replying = false
|
replying = false
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Comment from './Comment.svelte'
|
import Comment from './Comment.svelte'
|
||||||
import { buildCommentsTree, type CommentNodeI } from './comments'
|
import { buildCommentsTree, type CommentNodeI } from './comments'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
import { onMount } from 'svelte'
|
import { onMount, setContext } from 'svelte'
|
||||||
import Button from '$lib/components/input/Button.svelte'
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
import { ChevronDown, Icon } from 'svelte-hero-icons'
|
import { ChevronDown, Icon } from 'svelte-hero-icons'
|
||||||
import { authData, getClient } from '$lib/lemmy.js'
|
import { authData, getClient } from '$lib/lemmy.js'
|
||||||
@@ -14,6 +14,10 @@
|
|||||||
export let isParent: boolean
|
export let isParent: boolean
|
||||||
export let post: Post
|
export let post: Post
|
||||||
|
|
||||||
|
if (isParent) {
|
||||||
|
setContext('comments:tree', nodes)
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (isParent && $page.url.hash) {
|
if (isParent && $page.url.hash) {
|
||||||
document.getElementById($page.url.hash)?.scrollIntoView({
|
document.getElementById($page.url.hash)?.scrollIntoView({
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
{#if post.body}
|
{#if post.body}
|
||||||
<p
|
<p
|
||||||
class="bg-slate-100 border border-slate-200 dark:border-zinc-800
|
class="bg-slate-100 border border-slate-200 dark:border-zinc-800
|
||||||
dark:bg-zinc-900 p-2 text-sm rounded-md leading-[22px]"
|
dark:bg-zinc-900 p-2 md:p-4 text-sm rounded-md leading-[22px]"
|
||||||
>
|
>
|
||||||
<Markdown source={post.body} />
|
<Markdown source={post.body} />
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in new issue
Block a user