fix: Twemoji reaction
This commit is contained in:
parent
0684ba645e
commit
027bfdadeb
1 changed files with 8 additions and 1 deletions
|
@ -3,7 +3,7 @@ import { Box, Text, as } from 'folds';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { MatrixClient, MatrixEvent, Room } from 'matrix-js-sdk';
|
import { MatrixClient, MatrixEvent, Room } from 'matrix-js-sdk';
|
||||||
import * as css from './Reaction.css';
|
import * as css from './Reaction.css';
|
||||||
import { getHexcodeForEmoji, getShortcodeFor } from '../../plugins/emoji';
|
import { getHexcodeForEmoji, getShortcodeFor, getEmojiUrl, isUsingTwemoji } from '../../plugins/emoji';
|
||||||
import { getMemberDisplayName } from '../../utils/room';
|
import { getMemberDisplayName } from '../../utils/room';
|
||||||
import { eventWithShortcode, getMxIdLocalPart } from '../../utils/matrix';
|
import { eventWithShortcode, getMxIdLocalPart } from '../../utils/matrix';
|
||||||
|
|
||||||
|
@ -31,6 +31,13 @@ export const Reaction = as<
|
||||||
src={mx.mxcUrlToHttp(reaction) ?? reaction}
|
src={mx.mxcUrlToHttp(reaction) ?? reaction}
|
||||||
alt={reaction}
|
alt={reaction}
|
||||||
/>
|
/>
|
||||||
|
) : isUsingTwemoji() ? (
|
||||||
|
<img
|
||||||
|
className={css.ReactionImg}
|
||||||
|
src={getEmojiUrl(reaction)}
|
||||||
|
alt={reaction}
|
||||||
|
title={getShortcodeFor(getHexcodeForEmoji(reaction))}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Text as="span" size="Inherit" truncate>
|
<Text as="span" size="Inherit" truncate>
|
||||||
{reaction}
|
{reaction}
|
||||||
|
|
Loading…
Reference in a new issue