From 02de0ed825667c5a40be5c18b86f71152198e77a Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 8 Jan 2022 17:14:23 -0500 Subject: [PATCH] Add icons for unicode emoji groups --- src/components/emoji_picker/emoji_picker.js | 36 +++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 4990afb3e7..bf4a98d4d6 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -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 })) },