Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d4ea509

Browse files
tulirsumnerevans
authored andcommitted
Add support for rendering custom emojis in reactions
1 parent 2ea8a03 commit d4ea509

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/components/views/messages/ReactionsRowButton.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import React from "react";
1818
import classNames from "classnames";
1919
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
2020

21+
import { mediaFromMxc } from "../../../customisations/Media";
2122
import { _t } from "../../../languageHandler";
2223
import { formatCommaSeparatedList } from "../../../utils/FormattingUtils";
2324
import dis from "../../../dispatcher/dispatcher";
@@ -130,9 +131,19 @@ export default class ReactionsRowButton extends React.PureComponent<IProps, ISta
130131
onMouseOver={this.onMouseOver}
131132
onMouseLeave={this.onMouseLeave}
132133
>
133-
<span className="mx_ReactionsRowButton_content" aria-hidden="true">
134-
{content}
135-
</span>
134+
{content.startsWith("mxc://") ? (
135+
<img
136+
className="mx_ReactionsRowButton_content"
137+
alt={content}
138+
src={mediaFromMxc(content).srcHttp}
139+
width="16"
140+
height="16"
141+
/>
142+
) : (
143+
<span className="mx_ReactionsRowButton_content" aria-hidden="true">
144+
{content}
145+
</span>
146+
)}
136147
<span className="mx_ReactionsRowButton_count" aria-hidden="true">
137148
{count}
138149
</span>

0 commit comments

Comments
 (0)