misc: tweak comments
This commit is contained in:
1 parent
9f91929bd2
commit
8733b9da6d
2 files changed
+11
-12
No files matched your search
@@ -19,6 +19,7 @@
|
|||||||
import { toast } from '$lib/components/ui/toasts/toasts.js'
|
import { toast } from '$lib/components/ui/toasts/toasts.js'
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
|
|
||||||
export let node: CommentNodeI
|
export let node: CommentNodeI
|
||||||
export let postId: number
|
export let postId: number
|
||||||
@@ -75,9 +76,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<li
|
<li
|
||||||
class="py-2 {node.depth == 0
|
class="py-2 {$$props.class}"
|
||||||
? 'border-b border-slate-200 dark:border-zinc-800'
|
|
||||||
: ''} {$$props.class}"
|
|
||||||
id="#{node.comment_view.comment.id.toString()}"
|
id="#{node.comment_view.comment.id.toString()}"
|
||||||
>
|
>
|
||||||
<details bind:open class="flex flex-col gap-1">
|
<details bind:open class="flex flex-col gap-1">
|
||||||
@@ -128,11 +127,11 @@
|
|||||||
<Icon src={Bookmark} solid size="12" title="Saved" />
|
<Icon src={Bookmark} solid size="12" title="Saved" />
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<Button
|
||||||
class="ml-auto translate-x-1 opacity-0
|
class="ml-auto translate-x-1 opacity-0 group-hover:translate-x-0
|
||||||
group-hover:translate-x-0 group-hover:opacity-100 text-xs transition-all
|
group-hover:opacity-100 text-xs !transition-all
|
||||||
flex flex-row items-center gap-1 dark:bg-zinc-900 p-1 rounded-md
|
pointer-events-none"
|
||||||
bg-slate-200 hover:brightness-125 px-2"
|
size="sm"
|
||||||
>
|
>
|
||||||
{#if open}
|
{#if open}
|
||||||
<Icon src={Minus} width={16} height={16} mini />
|
<Icon src={Minus} width={16} height={16} mini />
|
||||||
@@ -142,7 +141,7 @@
|
|||||||
<span class="text-xs opacity-50">+{node.children.length}</span>
|
<span class="text-xs opacity-50">+{node.children.length}</span>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</Button>
|
||||||
</summary>
|
</summary>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col whitespace-pre-wrap
|
class="flex flex-col whitespace-pre-wrap
|
||||||
|
|||||||
@@ -98,8 +98,8 @@
|
|||||||
<ul
|
<ul
|
||||||
in:fly={{ opacity: 0, y: -4 }}
|
in:fly={{ opacity: 0, y: -4 }}
|
||||||
class={isParent
|
class={isParent
|
||||||
? ''
|
? 'divide-y dark:divide-zinc-800 divide-slate-200'
|
||||||
: 'mt-2 pl-3.5 border-l-2 border-slate-200 dark:border-zinc-900'}
|
: 'pl-3.5 border-l-2 border-slate-200 dark:border-zinc-800 my-1'}
|
||||||
>
|
>
|
||||||
{#each nodes as node (node.comment_view.comment.id)}
|
{#each nodes as node (node.comment_view.comment.id)}
|
||||||
<Comment
|
<Comment
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
|
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
|
||||||
<div
|
<div
|
||||||
class="my-2 min-w-[7rem] w-max h-8 border-l-2 border-slate-200 dark:border-zinc-900 pl-2"
|
class="my-2 w-max h-8 border-l-2 border-slate-200 dark:border-zinc-900 pl-2"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
loading={node.loading}
|
loading={node.loading}
|
||||||
|
|||||||
Reference in new issue
Block a user