mirror of
https://github.com/revoltchat/revite.git
synced 2025-02-21 07:42:52 -05:00
feat: render custom emoji
This commit is contained in:
parent
445e9537d4
commit
ec96dde694
1 changed files with 7 additions and 3 deletions
|
@ -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],
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue