diff --git a/apps/meteor/app/emoji/client/helpers.ts b/apps/meteor/app/emoji/client/helpers.ts index 6341fbfe2e1be..ac49033fe1929 100644 --- a/apps/meteor/app/emoji/client/helpers.ts +++ b/apps/meteor/app/emoji/client/helpers.ts @@ -57,7 +57,7 @@ export const createEmojiList = ( if (!image) { continue; } - emojiList.push({ emoji: current, image, emojiHandle: emojiToRender }); + emojiList.push({ emoji: current, image }); } }); diff --git a/apps/meteor/app/emoji/client/types.ts b/apps/meteor/app/emoji/client/types.ts index d4c7341993b58..d6356ef1901b0 100644 --- a/apps/meteor/app/emoji/client/types.ts +++ b/apps/meteor/app/emoji/client/types.ts @@ -3,7 +3,6 @@ import type { TranslationKey } from '@rocket.chat/ui-contexts'; export type EmojiItem = { emoji: string; image: string; - emojiHandle: string; }; export type EmojiCategory = { diff --git a/apps/meteor/client/components/message/toolbox/Toolbox.tsx b/apps/meteor/client/components/message/toolbox/Toolbox.tsx index 71e026948debb..731502428a560 100644 --- a/apps/meteor/client/components/message/toolbox/Toolbox.tsx +++ b/apps/meteor/client/components/message/toolbox/Toolbox.tsx @@ -92,18 +92,8 @@ const Toolbox = ({ message, messageContext, room, subscription }: ToolboxProps): return ( {recentList.length > 0 && - recentList.slice(0, 3).map(({ emoji, image, emojiHandle }) => { - return ( - handleSetReaction(emoji)} - /> - ); + recentList.slice(0, 3).map(({ emoji, image }) => { + return handleSetReaction(emoji)} />; })} {actionsQueryResult.data?.message.map((action) => ( {categoryKey === CUSTOM_CATEGORY && emojis.list.map( - ({ emoji, image, emojiHandle }, index = 1) => + ({ emoji, image }, index = 1) => index < customItemsLimit && ( - + ), )} {!(categoryKey === CUSTOM_CATEGORY) && - emojis.list.map(({ emoji, image, emojiHandle }) => ( - + emojis.list.map(({ emoji, image }) => ( + ))} diff --git a/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx b/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx index e635ab817e2ff..9dad1e7852d33 100644 --- a/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx +++ b/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx @@ -4,7 +4,6 @@ import type { MouseEvent, AllHTMLAttributes } from 'react'; import React, { memo } from 'react'; import type { EmojiItem } from '../../../../app/emoji/client'; -import Emoji from '../../../components/Emoji'; import { usePreviewEmoji } from '../../../contexts/EmojiPickerContext'; type EmojiElementProps = EmojiItem & { small?: boolean; onClick: (e: MouseEvent) => void } & Omit< @@ -12,9 +11,13 @@ type EmojiElementProps = EmojiItem & { small?: boolean; onClick: (e: MouseEvent< 'is' >; -const EmojiElement = ({ emoji, image, emojiHandle, onClick, small = false, ...props }: EmojiElementProps) => { +const EmojiElement = ({ emoji, image, onClick, small = false, ...props }: EmojiElementProps) => { const { handlePreview, handleRemovePreview } = usePreviewEmoji(); + if (!image) { + return null; + } + const emojiSmallClass = css` > .emoji, .emojione { @@ -23,7 +26,7 @@ const EmojiElement = ({ emoji, image, emojiHandle, onClick, small = false, ...pr } `; - const emojiElement = ; + const emojiElement =
; return ( { - const { emoji, image, emojiHandle } = searchResults[index] || {}; - return ; + const { emoji, image } = searchResults[index] || {}; + return ; }} /> );