fix(reactions): Get reaction emoji list from settings.yml

This commit is contained in:
Lucas Fialho Zawacki 2023-10-17 18:44:05 -03:00
parent 5f1bed6d44
commit b2f25decd6
2 changed files with 17 additions and 29 deletions

View File

@ -10,6 +10,8 @@ import { init } from 'emoji-mart';
import Styled from './styles';
const REACTIONS = Meteor.settings.public.userReaction.reactions;
const ReactionsButton = (props) => {
const {
intl,
@ -87,36 +89,9 @@ const ReactionsButton = (props) => {
native: '✋',
};
const reactions = [
{
id: 'smiley',
native: '😃',
},
{
id: 'neutral_face',
native: '😐',
},
{
id: 'slightly_frowning_face',
native: '🙁',
},
{
id: '+1',
native: '👍',
},
{
id: '-1',
native: '👎',
},
{
id: 'clap',
native: '👏',
},
];
let actions = [];
reactions.forEach(({ id, native }) => {
REACTIONS.forEach(({ id, native }) => {
actions.push({
label: <Styled.ButtonWrapper active={currentUserReaction === native}><em-emoji key={native} native={native} {...emojiProps} /></Styled.ButtonWrapper>,
key: id,
@ -133,7 +108,7 @@ const ReactionsButton = (props) => {
});
const icon = !raiseHand && currentUserReaction === 'none' ? 'hand' : null;
const currentUserReactionEmoji = reactions.find(({ native }) => native === currentUserReaction);
const currentUserReactionEmoji = REACTIONS.find(({ native }) => native === currentUserReaction);
let customIcon = null;

View File

@ -602,6 +602,19 @@ public:
userReaction:
enabled: true
expire: 60
reactions:
- id: 'smiley'
native: '😃'
- id: 'neutral_face'
native: '😐'
- id: 'slightly_frowning_face'
native: '🙁'
- id: '+1'
native: '👍'
- id: '-1'
native: '👎'
- id: 'clap'
native: '👏'
userStatus:
enabled: false
notes: