mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
feat: render custom emoji
This commit is contained in:
@@ -15,15 +15,19 @@ const Emoji = styled.img`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export function RenderEmoji({ match }: CustomComponentProps) {
|
export function RenderEmoji({ match }: CustomComponentProps) {
|
||||||
|
const url =
|
||||||
|
match in emojiDictionary
|
||||||
|
? parseEmoji(emojiDictionary[match as keyof typeof emojiDictionary])
|
||||||
|
: clientController.getAvailableClient().emojis!.get(match)!
|
||||||
|
.imageURL;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Emoji
|
<Emoji
|
||||||
alt={match}
|
alt={match}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
className="emoji"
|
className="emoji"
|
||||||
draggable={false}
|
draggable={false}
|
||||||
src={parseEmoji(
|
src={url}
|
||||||
emojiDictionary[match as keyof typeof emojiDictionary],
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user