feat: render custom emoji

feat/custom-emoji-autocomplete
Paul Makles 2022-07-08 17:14:15 +01:00
parent 445e9537d4
commit ec96dde694
1 changed files with 7 additions and 3 deletions

View File

@ -15,15 +15,19 @@ const Emoji = styled.img`
`;
export function RenderEmoji({ match }: CustomComponentProps) {
const url =
match in emojiDictionary
? parseEmoji(emojiDictionary[match as keyof typeof emojiDictionary])
: clientController.getAvailableClient().emojis!.get(match)!
.imageURL;
return (
<Emoji
alt={match}
loading="lazy"
className="emoji"
draggable={false}
src={parseEmoji(
emojiDictionary[match as keyof typeof emojiDictionary],
)}
src={url}
/>
);
}