diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-02-28 20:27:02 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-02-28 20:27:02 +0000 |
| commit | 1b9805b550444403792db2304b5a6d5681e8f30d (patch) | |
| tree | 052299372a386107d277c414148c9f3d63408c1c /src/components/react_button/react_button.js | |
| parent | 3ab128e73924ce34d190ff609cb9b081cdffe402 (diff) | |
| parent | 57e72b48c1fec74a860fd5abc75f0e9c4986c3f6 (diff) | |
Merge branch 'develop' into 'master'
Update master with 2.0.0
See merge request pleroma/pleroma-fe!1074
Diffstat (limited to 'src/components/react_button/react_button.js')
| -rw-r--r-- | src/components/react_button/react_button.js | 39 |
1 files changed, 39 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..19949563 --- /dev/null +++ b/src/components/react_button/react_button.js @@ -0,0 +1,39 @@ +import Popover from '../popover/popover.vue' +import { mapGetters } from 'vuex' + +const ReactButton = { + props: ['status', 'loggedIn'], + data () { + return { + filterWord: '' + } + }, + components: { + Popover + }, + methods: { + addReaction (event, emoji, close) { + const existingReaction = this.status.emoji_reactions.find(r => r.name === emoji) + if (existingReaction && existingReaction.me) { + this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji }) + } else { + this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji }) + } + close() + } + }, + 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 |
