2018-02-07 09:34:43 +00:00
|
|
|
<template>
|
2020-02-21 21:43:46 +00:00
|
|
|
<div class="tdflqwzn" :class="{ isMe }">
|
2020-07-26 23:46:21 +00:00
|
|
|
<x-reaction v-for="(count, reaction) in reactions" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note" :my-reaction="myReaction" :emojis="emojis" :key="reaction"/>
|
2018-02-07 09:34:43 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2018-02-16 06:38:12 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2019-02-06 17:05:49 +00:00
|
|
|
import XReaction from './reactions-viewer.reaction.vue';
|
2018-11-08 18:44:35 +00:00
|
|
|
|
2018-02-16 06:38:12 +00:00
|
|
|
export default Vue.extend({
|
2019-02-06 17:05:49 +00:00
|
|
|
components: {
|
|
|
|
XReaction
|
|
|
|
},
|
2018-12-27 13:54:50 +00:00
|
|
|
props: {
|
|
|
|
note: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
2019-02-06 17:05:49 +00:00
|
|
|
},
|
2020-07-26 23:46:21 +00:00
|
|
|
reactions: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
myReaction: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
emojis: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
initialReactions: new Set(Object.keys(this.note.reactions))
|
|
|
|
};
|
2018-12-27 13:54:50 +00:00
|
|
|
},
|
2018-02-16 06:38:12 +00:00
|
|
|
computed: {
|
2018-12-27 13:54:50 +00:00
|
|
|
isMe(): boolean {
|
2019-02-06 17:05:49 +00:00
|
|
|
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
|
2018-12-16 18:29:57 +00:00
|
|
|
},
|
|
|
|
},
|
2018-02-16 06:38:12 +00:00
|
|
|
});
|
2018-02-07 09:41:48 +00:00
|
|
|
</script>
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
<style lang="scss" scoped>
|
2020-02-21 21:43:46 +00:00
|
|
|
.tdflqwzn {
|
2020-01-29 19:37:25 +00:00
|
|
|
margin: 4px -2px 0 -2px;
|
2018-02-07 09:41:48 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2018-02-07 09:41:48 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
&.isMe {
|
|
|
|
> span {
|
|
|
|
cursor: default !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-07 09:41:48 +00:00
|
|
|
</style>
|