monkeeShark/src/client/app/common/views/components/reactions-viewer.vue
Aya Morisawa be33581642 Fix animation not being performed on new reaction (#5345)
* Fix animation not being performed on new reaction

* Clean up
2019-08-29 05:11:26 +09:00

50 lines
983 B
Vue

<template>
<div class="mk-reactions-viewer" :class="{ isMe }">
<x-reaction v-for="(count, reaction) in reactions" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note" :key="reaction"/>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import XReaction from './reactions-viewer.reaction.vue';
export default Vue.extend({
components: {
XReaction
},
data() {
return {
initialReactions: new Set(Object.keys(this.note.reactions))
};
},
props: {
note: {
type: Object,
required: true
},
},
computed: {
reactions(): any {
return this.note.reactions;
},
isMe(): boolean {
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
},
},
});
</script>
<style lang="stylus" scoped>
.mk-reactions-viewer
margin: 4px -2px
&:empty
display none
&.isMe
> span
cursor default !important
&:hover
background var(--reactionViewerButtonBg) !important
</style>