#101 - show emojis in groups, clean up
This commit is contained in:
parent
2c4e80aab3
commit
f9071dac25
2 changed files with 89 additions and 29 deletions
src/components/emoji-selector
|
@ -1,24 +1,35 @@
|
|||
const filterByKeyword = (list, keyword = '') => {
|
||||
return list.filter(x => x.shortcode.indexOf(keyword) !== -1)
|
||||
}
|
||||
|
||||
const EmojiSelector = {
|
||||
data () {
|
||||
return {
|
||||
open: false
|
||||
open: false,
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
console.log(this.$store.state.instance.emoji)
|
||||
console.log(this.$store.state.instance.customEmoji)
|
||||
},
|
||||
methods: {
|
||||
togglePanel () {
|
||||
this.open = !this.open
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
standardEmoji () {
|
||||
return this.$store.state.instance.emoji || []
|
||||
},
|
||||
customEmoji () {
|
||||
return this.$store.state.instance.customEmoji || []
|
||||
emojis () {
|
||||
const standardEmojis = this.$store.state.instance.emoji || []
|
||||
const customEmojis = this.$store.state.instance.customEmoji || []
|
||||
return {
|
||||
standard: {
|
||||
text: 'Standard',
|
||||
icon: 'icon-star',
|
||||
emojis: filterByKeyword(standardEmojis, this.keyword)
|
||||
},
|
||||
custom: {
|
||||
text: 'Custom',
|
||||
icon: 'icon-picture',
|
||||
emojis: filterByKeyword(customEmojis, this.keyword)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue