diff --git a/src/app/components/emoji-board/EmojiBoard.tsx b/src/app/components/emoji-board/EmojiBoard.tsx index 067ebe3..94ba14c 100644 --- a/src/app/components/emoji-board/EmojiBoard.tsx +++ b/src/app/components/emoji-board/EmojiBoard.tsx @@ -13,6 +13,7 @@ import React, { import { Badge, Box, + Chip, Icon, IconButton, Icons, @@ -623,6 +624,7 @@ export function EmojiBoard({ onEmojiSelect, onCustomEmojiSelect, onStickerSelect, + allowTextCustomEmoji, }: { tab?: EmojiBoardTab; onTabChange?: (tab: EmojiBoardTab) => void; @@ -632,6 +634,7 @@ export function EmojiBoard({ onEmojiSelect?: (unicode: string, shortcode: string) => void; onCustomEmojiSelect?: (mxc: string, shortcode: string) => void; onStickerSelect?: (mxc: string, shortcode: string) => void; + allowTextCustomEmoji?: boolean; }) { const emojiTab = tab === EmojiBoardTab.Emoji; const stickerTab = tab === EmojiBoardTab.Sticker; @@ -777,11 +780,33 @@ export function EmojiBoard({ {onTabChange && } } + after={ + allowTextCustomEmoji && result?.query ? ( + } + onClick={() => { + const searchInput = document.querySelector( + '[data-emoji-board-search="true"]' + ); + const textReaction = searchInput?.value.trim(); + if (!textReaction) return; + onCustomEmojiSelect?.(textReaction, textReaction); + requestClose(); + }} + > + React + + ) : ( + + ) + } onChange={handleOnChange} autoFocus={!mobileOrTablet()} /> diff --git a/src/app/organisms/room/message/Message.tsx b/src/app/organisms/room/message/Message.tsx index f5d2550..e26f366 100644 --- a/src/app/organisms/room/message/Message.tsx +++ b/src/app/organisms/room/message/Message.tsx @@ -734,6 +734,7 @@ export const Message = as<'div', MessageProps>( { onReactionToggle(mEvent.getId()!, key); setEmojiBoard(false);