pleroma-fe/src/components/react_button/react_button.js

44 lines
1 KiB
JavaScript
Raw Normal View History

import { mapGetters } from 'vuex'
const ReactButton = {
props: ['status', 'loggedIn'],
data () {
return {
showTooltip: false,
filterWord: '',
popperOptions: {
modifiers: {
preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
}
}
}
},
methods: {
2020-01-14 19:06:14 +11:00
openReactionSelect () {
this.showTooltip = true
this.filterWord = ''
},
closeReactionSelect () {
this.showTooltip = false
},
addReaction (event, emoji) {
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
this.closeReactionSelect()
}
},
computed: {
commonEmojis () {
2020-01-29 02:09:25 +11:00
return ['❤️', '😠', '👀', '😂', '🔥']
},
emojis () {
if (this.filterWord !== '') {
return this.$store.state.instance.emoji.filter(emoji => emoji.displayText.includes(this.filterWord))
}
return this.$store.state.instance.emoji || []
},
...mapGetters(['mergedConfig'])
}
}
export default ReactButton