make upvotes work
This commit is contained in:
parent
248555f7ad
commit
11deee34a7
4 changed files with 93 additions and 25 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue