2024-06-30 20:53:51 +01:00
|
|
|
<script>
|
|
|
|
import ReactionButton from './ReactionButton.svelte';
|
|
|
|
import ReactIcon from '../../../img/icons/react.svg';
|
|
|
|
|
|
|
|
export let post;
|
|
|
|
</script>
|
|
|
|
|
2024-06-30 21:08:14 +01:00
|
|
|
<div class="post-reactions" aria-label="Reactions" on:mouseup|stopPropagation on:keydown|stopPropagation>
|
2024-06-30 20:53:51 +01:00
|
|
|
{#each post.reactions as reaction}
|
|
|
|
<ReactionButton
|
|
|
|
type="reaction"
|
|
|
|
on:click={() => toggleReaction(reaction)}
|
|
|
|
bind:active={reaction.me}
|
|
|
|
bind:count={reaction.count}
|
|
|
|
disabled={reaction.name.includes('@')}
|
|
|
|
title={reaction.name}
|
|
|
|
label="">
|
|
|
|
{#if reaction.url}
|
|
|
|
<img src={reaction.url} class="emoji" height="20" title={reaction.name} alt={reaction.name}>
|
|
|
|
{:else}
|
|
|
|
{reaction.name}
|
|
|
|
{/if}
|
|
|
|
</ReactionButton>
|
|
|
|
{/each}
|
|
|
|
<ReactionButton
|
|
|
|
type="reaction"
|
|
|
|
title="react"
|
|
|
|
label="React"
|
|
|
|
disabled>
|
|
|
|
<ReactIcon/>
|
|
|
|
</ReactionButton>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.post-reactions {
|
|
|
|
width: fit-content;
|
2024-07-02 19:38:20 +01:00
|
|
|
min-height: 32px;
|
2024-06-30 20:53:51 +01:00
|
|
|
margin-top: 8px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
2024-07-02 19:38:20 +01:00
|
|
|
flex-wrap: wrap;
|
2024-06-30 20:53:51 +01:00
|
|
|
gap: 2px;
|
|
|
|
}
|
|
|
|
</style>
|