diff --git a/src/app/molecules/message/Message.jsx b/src/app/molecules/message/Message.jsx index 6fe001b..c0975b1 100644 --- a/src/app/molecules/message/Message.jsx +++ b/src/app/molecules/message/Message.jsx @@ -298,19 +298,17 @@ function pickEmoji(e, roomId, eventId, roomTimeline) { } function genReactionMsg(userIds, reaction) { - const genLessContText = (text) => {text}; - let msg = <>; - userIds.forEach((userId, index) => { - if (index === 0) msg = <>{getUsername(userId)}; - // eslint-disable-next-line react/jsx-one-expression-per-line - else if (index === userIds.length - 1) msg = <>{msg}{genLessContText(' and ')}{getUsername(userId)}; - // eslint-disable-next-line react/jsx-one-expression-per-line - else msg = <>{msg}{genLessContText(', ')}{getUsername(userId)}; - }); return ( <> - {msg} - {genLessContText(' reacted with')} + {userIds.map((userId, index) => ( + <> + {twemojify(getUsername(userId))} + + {index === userIds.length - 1 ? ' and ' : ', '} + + + ))} + {' reacted with '} {twemojify(reaction, { className: 'react-emoji' })} );