wip commit, add basic popover for emoji reaction select
This commit is contained in:
parent
d007502629
commit
de945ba3e9
5 changed files with 138 additions and 3 deletions
50
src/components/react_button/react_button.js
Normal file
50
src/components/react_button/react_button.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
import { mapGetters } from 'vuex'
|
||||
|
||||
const ReactButton = {
|
||||
props: ['status', 'loggedIn'],
|
||||
data () {
|
||||
return {
|
||||
animated: false,
|
||||
showTooltip: false,
|
||||
popperOptions: {
|
||||
modifiers: {
|
||||
preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openReactionSelect () {
|
||||
console.log('test')
|
||||
this.showTooltip = true
|
||||
},
|
||||
closeReactionSelect () {
|
||||
this.showTooltip = false
|
||||
},
|
||||
favorite () {
|
||||
if (!this.status.favorited) {
|
||||
this.$store.dispatch('favorite', { id: this.status.id })
|
||||
} else {
|
||||
this.$store.dispatch('unfavorite', { id: this.status.id })
|
||||
}
|
||||
this.animated = true
|
||||
setTimeout(() => {
|
||||
this.animated = false
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
emojis () {
|
||||
return this.$store.state.instance.emoji || []
|
||||
},
|
||||
classes () {
|
||||
return {
|
||||
'icon-smile': true,
|
||||
'animate-spin': this.animated
|
||||
}
|
||||
},
|
||||
...mapGetters(['mergedConfig'])
|
||||
}
|
||||
}
|
||||
|
||||
export default ReactButton
|
Loading…
Add table
Add a link
Reference in a new issue