make upvotes work

This commit is contained in:
Yusur 2025-10-23 11:08:14 +02:00
parent 248555f7ad
commit 11deee34a7
4 changed files with 93 additions and 25 deletions

View file

@ -18,7 +18,7 @@
let { post }: { post: PostEntry } = $props();
let me = getMe();
let { title, created_at, id, content = '', to } = post;
let { title, id, content = '', to, votes, my_vote } = post;
</script>
<SLayout title={to.display_name + (to.type === 'guild' ? ` (+${to.name})` : to.type === 'user' ? ` (@${to.username})` : '')}>
@ -34,10 +34,10 @@ let { title, created_at, id, content = '', to } = post;
<!-- content, formatted as markdown -->
</div>
</div><!-- .post-body -->
<div class="message-stats">
<aside class="message-stats">
<!-- upvotes / downvotes -->
<VoteButton />
</div>
<VoteButton score={votes} vote={my_vote} {id} />
</aside>
<ul class="message-options row">
{#if me && me.id !== post.author?.id}
<li><a href="/report/post/{id}"><RiFlagLine/> Report</a></li>