forked from blisstown/campfire
slight post UI polish
This commit is contained in:
parent
c8f38bfd4a
commit
7715e747a2
8 changed files with 185 additions and 202 deletions
43
src/lib/ui/post/ReactionBar.svelte
Normal file
43
src/lib/ui/post/ReactionBar.svelte
Normal file
|
@ -0,0 +1,43 @@
|
|||
<script>
|
||||
import ReactionButton from './ReactionButton.svelte';
|
||||
import ReactIcon from '../../../img/icons/react.svg';
|
||||
|
||||
export let post;
|
||||
</script>
|
||||
|
||||
<div class="post-reactions" aria-label="Reactions" on:click|stopPropagation on:keydown|stopPropagation>
|
||||
{#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;
|
||||
height: 32px;
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 2px;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue