aboutsummaryrefslogtreecommitdiff
path: root/src/components/react_button/react_button.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/react_button/react_button.js')
-rw-r--r--src/components/react_button/react_button.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/components/react_button/react_button.js b/src/components/react_button/react_button.js
new file mode 100644
index 00000000..76a49305
--- /dev/null
+++ b/src/components/react_button/react_button.js
@@ -0,0 +1,49 @@
+import { mapGetters } from 'vuex'
+
+const ReactButton = {
+ props: ['status', 'loggedIn'],
+ data () {
+ return {
+ animated: false,
+ showTooltip: false,
+ filterWord: '',
+ popperOptions: {
+ modifiers: {
+ preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
+ }
+ }
+ }
+ },
+ methods: {
+ toggleReactionSelect () {
+ this.showTooltip = !this.showTooltip
+ },
+ closeReactionSelect () {
+ this.showTooltip = false
+ },
+ addReaction (event, emoji) {
+ this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
+ this.closeReactionSelect()
+ }
+ },
+ computed: {
+ commonEmojis () {
+ return ['💖', '😠', '👀', '😂', '🔥']
+ },
+ emojis () {
+ if (this.filterWord !== '') {
+ return this.$store.state.instance.emoji.filter(emoji => emoji.displayText.includes(this.filterWord))
+ }
+ return this.$store.state.instance.emoji || []
+ },
+ classes () {
+ return {
+ 'icon-smile': true,
+ 'animate-spin': this.animated
+ }
+ },
+ ...mapGetters(['mergedConfig'])
+ }
+}
+
+export default ReactButton