misc: tweak post page

This commit is contained in:
Xyphyn committed 2023-08-31 19:12:07 -07:00
1 parent 72cfd7a894
commit e209a22d2c
2 files changed
+28 -16

No files matched your search

@@ -4,7 +4,7 @@
import { page } from '$app/stores'
import { onMount, setContext } from 'svelte'
import Button from '$lib/components/input/Button.svelte'
import { ChevronDown, Icon } from 'svelte-hero-icons'
import { ChevronDown, Icon, Plus, PlusCircle } from 'svelte-hero-icons'
import { getClient } from '$lib/lemmy.js'
import type { CommentView, Post } from 'lemmy-js-client'
import { fly } from 'svelte/transition'
@@ -112,23 +112,29 @@
<svelte:self {post} bind:nodes={node.children} isParent={false} />
{/if}
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
<div
class="my-2 w-max h-8 border-l-2 border-slate-200 dark:border-zinc-900 pl-2"
<button
class="w-full my-2 h-8 border-l-2 border-slate-200 dark:border-zinc-800 pl-2 text-left"
on:click={() => {
node.loading = true
fetchChildren(node).then(() => (node.loading = false))
}}
>
<Button
loading={node.loading}
disabled={node.loading}
size="sm"
color="tertiary"
alignment="left"
loaderWidth={18}
on:click={() => {
node.loading = true
fetchChildren(node).then(() => (node.loading = false))
}}
>
<Icon src={ChevronDown} width={16} mini slot="icon" />
<Icon src={Plus} width={18} mini slot="icon" />
{node.comment_view.counts.child_count} more
</Button>
</div>
</button>
{/if}
</Comment>
{/each}