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'; import Styled from './styles';
const REACTIONS = Meteor.settings.public.userReaction.reactions;
const ReactionsButton = (props) => { const ReactionsButton = (props) => {
const { const {
intl, intl,
@ -87,36 +89,9 @@ const ReactionsButton = (props) => {
native: '✋', 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 = []; let actions = [];
reactions.forEach(({ id, native }) => { REACTIONS.forEach(({ id, native }) => {
actions.push({ actions.push({
label: <Styled.ButtonWrapper active={currentUserReaction === native}><em-emoji key={native} native={native} {...emojiProps} /></Styled.ButtonWrapper>, label: <Styled.ButtonWrapper active={currentUserReaction === native}><em-emoji key={native} native={native} {...emojiProps} /></Styled.ButtonWrapper>,
key: id, key: id,
@ -133,7 +108,7 @@ const ReactionsButton = (props) => {
}); });
const icon = !raiseHand && currentUserReaction === 'none' ? 'hand' : null; const icon = !raiseHand && currentUserReaction === 'none' ? 'hand' : null;
const currentUserReactionEmoji = reactions.find(({ native }) => native === currentUserReaction); const currentUserReactionEmoji = REACTIONS.find(({ native }) => native === currentUserReaction);
let customIcon = null; let customIcon = null;

View File

@ -602,6 +602,19 @@ public:
userReaction: userReaction:
enabled: true enabled: true
expire: 60 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: userStatus:
enabled: false enabled: false
notes: notes: