i forgot whatever i've been doing, i think i added an inbox

This commit is contained in:
Xyphyn committed 2023-07-04 18:45:15 -07:00
1 parent ef037349f0
commit 04704749b7
24 files changed
+307 -86

No files matched your search

@@ -0,0 +1,35 @@
<script lang="ts">
import Comment from './Comment.svelte'
import type { CommentNodeI } from './comments'
import type { Post } from 'lemmy-js-client'
import { page } from '$app/stores'
import { onMount } from 'svelte'
const maxComments = 250
export let nodes: CommentNodeI[]
export let isParent: boolean
export let post: Post
onMount(() => {
if (isParent && $page.url.hash) {
document.getElementById($page.url.hash)?.scrollIntoView({
behavior: 'smooth',
})
}
})
</script>
<ul
class={isParent
? ''
: 'ml-2.5 mt-2 px-2.5 border-l-2 border-black/10 dark:border-white/10'}
>
{#each nodes.slice(0, maxComments) as node}
<Comment postId={post.id} {node} open={true}>
{#if node.children?.length > 0}
<svelte:self {post} nodes={node.children} isParent={false} />
{/if}
</Comment>
{/each}
</ul>