add CommentCount
This commit is contained in:
parent
11deee34a7
commit
da1c2809d9
3 changed files with 36 additions and 2 deletions
|
|
@ -12,13 +12,14 @@
|
|||
import { SvelteShowdown } from "svelte-showdown";
|
||||
import VoteButton from "./VoteButton.svelte";
|
||||
import { getMe } from "./globals.svelte";
|
||||
import CommentCount from "./CommentCount.svelte";
|
||||
|
||||
|
||||
|
||||
let { post }: { post: PostEntry } = $props();
|
||||
|
||||
let me = getMe();
|
||||
let { title, id, content = '', to, votes, my_vote } = post;
|
||||
let { title, id, content = '', to, votes, my_vote, comment_count } = post;
|
||||
</script>
|
||||
|
||||
<SLayout title={to.display_name + (to.type === 'guild' ? ` (+${to.name})` : to.type === 'user' ? ` (@${to.username})` : '')}>
|
||||
|
|
@ -37,6 +38,7 @@ let { title, id, content = '', to, votes, my_vote } = post;
|
|||
<aside class="message-stats">
|
||||
<!-- upvotes / downvotes -->
|
||||
<VoteButton score={votes} vote={my_vote} {id} />
|
||||
<CommentCount count={comment_count} />
|
||||
</aside>
|
||||
<ul class="message-options row">
|
||||
{#if me && me.id !== post.author?.id}
|
||||
|
|
@ -49,6 +51,8 @@ let { title, id, content = '', to, votes, my_vote } = post;
|
|||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
{#snippet left()}
|
||||
{#if to.type === 'guild'}
|
||||
<GuildMenu guild={to} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue