Temp EmojiBoard performance improved
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
34862f9ace
commit
0b43431543
1 changed files with 4 additions and 3 deletions
|
@ -29,7 +29,7 @@ import BulbIC from '../../../../public/res/ic/outlined/bulb.svg';
|
||||||
import PeaceIC from '../../../../public/res/ic/outlined/peace.svg';
|
import PeaceIC from '../../../../public/res/ic/outlined/peace.svg';
|
||||||
import FlagIC from '../../../../public/res/ic/outlined/flag.svg';
|
import FlagIC from '../../../../public/res/ic/outlined/flag.svg';
|
||||||
|
|
||||||
function EmojiGroup({ name, groupEmojis }) {
|
const EmojiGroup = React.memo(({ name, groupEmojis }) => {
|
||||||
function getEmojiBoard() {
|
function getEmojiBoard() {
|
||||||
const emojiBoard = [];
|
const emojiBoard = [];
|
||||||
const ROW_EMOJIS_COUNT = 7;
|
const ROW_EMOJIS_COUNT = 7;
|
||||||
|
@ -64,7 +64,7 @@ function EmojiGroup({ name, groupEmojis }) {
|
||||||
alt={emoji.shortcode}
|
alt={emoji.shortcode}
|
||||||
unicode={`:${emoji.shortcode}:`}
|
unicode={`:${emoji.shortcode}:`}
|
||||||
shortcodes={emoji.shortcode}
|
shortcodes={emoji.shortcode}
|
||||||
src={initMatrix.matrixClient.mxcUrlToHttp(emoji.mxc, 38, 38, 'crop')}
|
src={initMatrix.matrixClient.mxcUrlToHttp(emoji.mxc)}
|
||||||
data-mx-emoticon
|
data-mx-emoticon
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -83,7 +83,8 @@ function EmojiGroup({ name, groupEmojis }) {
|
||||||
{groupEmojis.length !== 0 && <div className="emoji-set">{getEmojiBoard()}</div>}
|
{groupEmojis.length !== 0 && <div className="emoji-set">{getEmojiBoard()}</div>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|
||||||
EmojiGroup.propTypes = {
|
EmojiGroup.propTypes = {
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
groupEmojis: PropTypes.arrayOf(PropTypes.shape({
|
groupEmojis: PropTypes.arrayOf(PropTypes.shape({
|
||||||
|
|
Loading…
Reference in a new issue