misskey-awawa/src/client/app/common/views/components/reactions-viewer.vue

46 lines
850 B
Vue
Raw Normal View History

2018-02-07 09:34:43 +00:00
<template>
<div class="mk-reactions-viewer" :class="{ isMe }">
<x-reaction v-for="(count, reaction) in reactions" :reaction="reaction" :count="count" :note="note" :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';
import XReaction from './reactions-viewer.reaction.vue';
2018-02-16 06:38:12 +00:00
export default Vue.extend({
components: {
XReaction
},
props: {
note: {
type: Object,
required: true
},
},
2018-02-16 06:38:12 +00:00
computed: {
2018-12-16 18:29:57 +00:00
reactions(): any {
2018-04-07 17:30:37 +00:00
return this.note.reactionCounts;
},
isMe(): boolean {
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>
<style lang="stylus" scoped>
2018-09-27 13:59:56 +00:00
.mk-reactions-viewer
margin: 4px -2px
2018-02-07 09:41:48 +00:00
2018-02-16 06:38:12 +00:00
&:empty
display none
2018-02-07 09:41:48 +00:00
&.isMe
> span
cursor default !important
&:hover
background var(--reactionViewerButtonBg) !important
2018-02-07 09:41:48 +00:00
</style>