Add icons for unicode emoji groups

This commit is contained in:
Tusooa Zhu 2022-01-08 17:14:23 -05:00
parent 8f4f02683f
commit 02de0ed825
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224
1 changed files with 33 additions and 3 deletions

View File

@ -6,16 +6,46 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import {
faBoxOpen,
faStickyNote,
faSmileBeam
faSmileBeam,
faSmile,
faUser,
faPaw,
faIceCream,
faBus,
faBasketballBall,
faLightbulb,
faCode,
faFlag
} from '@fortawesome/free-solid-svg-icons'
import { trim } from 'lodash'
library.add(
faBoxOpen,
faStickyNote,
faSmileBeam
faSmileBeam,
faSmile,
faUser,
faPaw,
faIceCream,
faBus,
faBasketballBall,
faLightbulb,
faCode,
faFlag
)
const UNICODE_EMOJI_GROUP_ICON = {
'smileys-and-emotion': 'smile',
'people-and-body': 'user',
'animals-and-nature': 'paw',
'food-and-drink': 'ice-cream',
'travel-and-places': 'bus',
'activities': 'basketball-ball',
'objects': 'lightbulb',
'symbols': 'code',
'flags': 'flag',
}
const filterByKeyword = (list, keyword = '') => {
if (keyword === '') return list
@ -218,7 +248,7 @@ const EmojiPicker = {
return this.$store.getters.standardEmojiGroupList.map(group => ({
id: `standard-${group.id}`,
text: this.$t(`emoji.unicode_groups.${group.id}`),
icon: 'box-open',
icon: UNICODE_EMOJI_GROUP_ICON[group.id],
emojis: group.emojis
}))
},