aboutsummaryrefslogtreecommitdiff
path: root/src/components/react_button/react_button.js
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-01-28 15:24:56 +0000
committerlain <lain@soykaf.club>2020-01-28 15:24:56 +0000
commit73253b87bfce0466848231da47e1864c6ff639b0 (patch)
tree732aff3bd3007c26c67e3de00a27379751b3a8a3 /src/components/react_button/react_button.js
parent4a11ee9768f2abbaa9da0e2454e2793734cce040 (diff)
parent6afff4f8c205ec70d3694564c706f6a46a61db9e (diff)
Merge branch 'feat/emoji-reactions' into 'develop'
Emoji reactions See merge request pleroma/pleroma-fe!1049
Diffstat (limited to 'src/components/react_button/react_button.js')
-rw-r--r--src/components/react_button/react_button.js43
1 files changed, 43 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..6fb2a780
--- /dev/null
+++ b/src/components/react_button/react_button.js
@@ -0,0 +1,43 @@
+import { mapGetters } from 'vuex'
+
+const ReactButton = {
+ props: ['status', 'loggedIn'],
+ data () {
+ return {
+ showTooltip: false,
+ filterWord: '',
+ popperOptions: {
+ modifiers: {
+ preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
+ }
+ }
+ }
+ },
+ methods: {
+ 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 () {
+ 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