misc: Split post component into more components

This commit is contained in:
Xyphyn committed 2023-07-18 16:38:45 -07:00
1 parent 58057bbeaa
commit b0f3e01f5a
9 files changed
+183 -188

No files matched your search

@@ -1,23 +1,11 @@
<script lang="ts">
import {
ArrowDown,
ArrowUp,
ChatBubbleOvalLeft,
ChevronDown,
ChevronUp,
Icon,
Minus,
Plus,
} from 'svelte-hero-icons'
import { Icon, Minus, Plus } from 'svelte-hero-icons'
import type { CommentNodeI } from './comments'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { Color } from '$lib/ui/colors.js'
import CommentForm from './CommentForm.svelte'
import { page } from '$app/stores'
import UserLink from '$lib/components/user/UserLink.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import CommentVote from '$lib/components/lemmy/comment/CommentVote.svelte'
import { userSettings } from '$lib/settings.js'
import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte'
export let node: CommentNodeI
@@ -7,9 +7,7 @@
import { ChevronDown, Icon } from 'svelte-hero-icons'
import { authData, getClient } from '$lib/lemmy.js'
import type { Post } from 'lemmy-js-client'
import { Color } from '$lib/ui/colors.js'
import { fly } from 'svelte/transition'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
export let nodes: CommentNodeI[]
export let isParent: boolean
@@ -71,3 +71,12 @@ export function buildCommentsTree(
return tree
}
export async function buildCommentsTreeAsync(
comments: CommentView[],
parentComment: boolean
) {
const result = buildCommentsTree(comments, parentComment)
return result
}