From 0b434315432c525260e17000ff910c1d95e4b27f Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Thu, 30 Dec 2021 16:37:11 +0530 Subject: [PATCH] Temp EmojiBoard performance improved Signed-off-by: Ajay Bura --- src/app/organisms/emoji-board/EmojiBoard.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/organisms/emoji-board/EmojiBoard.jsx b/src/app/organisms/emoji-board/EmojiBoard.jsx index b2a5e297..a9203871 100644 --- a/src/app/organisms/emoji-board/EmojiBoard.jsx +++ b/src/app/organisms/emoji-board/EmojiBoard.jsx @@ -29,7 +29,7 @@ import BulbIC from '../../../../public/res/ic/outlined/bulb.svg'; import PeaceIC from '../../../../public/res/ic/outlined/peace.svg'; import FlagIC from '../../../../public/res/ic/outlined/flag.svg'; -function EmojiGroup({ name, groupEmojis }) { +const EmojiGroup = React.memo(({ name, groupEmojis }) => { function getEmojiBoard() { const emojiBoard = []; const ROW_EMOJIS_COUNT = 7; @@ -64,7 +64,7 @@ function EmojiGroup({ name, groupEmojis }) { alt={emoji.shortcode} unicode={`:${emoji.shortcode}:`} shortcodes={emoji.shortcode} - src={initMatrix.matrixClient.mxcUrlToHttp(emoji.mxc, 38, 38, 'crop')} + src={initMatrix.matrixClient.mxcUrlToHttp(emoji.mxc)} data-mx-emoticon /> ) @@ -83,7 +83,8 @@ function EmojiGroup({ name, groupEmojis }) { {groupEmojis.length !== 0 &&
{getEmojiBoard()}
} ); -} +}); + EmojiGroup.propTypes = { name: PropTypes.string.isRequired, groupEmojis: PropTypes.arrayOf(PropTypes.shape({