mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-14 05:03:06 +03:00
Support blurhashes on stickers
This commit is contained in:
parent
3f9b6caacd
commit
44e14a7d43
1 changed files with 3 additions and 1 deletions
|
@ -18,6 +18,7 @@ import React from 'react';
|
|||
import MImageBody from './MImageBody';
|
||||
import * as sdk from '../../../index';
|
||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||
import {BLURHASH_FIELD} from "../../../ContentMessages";
|
||||
|
||||
@replaceableComponent("views.messages.MStickerBody")
|
||||
export default class MStickerBody extends MImageBody {
|
||||
|
@ -41,7 +42,8 @@ export default class MStickerBody extends MImageBody {
|
|||
|
||||
// Placeholder to show in place of the sticker image if
|
||||
// img onLoad hasn't fired yet.
|
||||
getPlaceholder() {
|
||||
getPlaceholder(width, height) {
|
||||
if (this.props.mxEvent.getContent().info[BLURHASH_FIELD]) return super.getPlaceholder(width, height);
|
||||
const TintableSVG = sdk.getComponent('elements.TintableSvg');
|
||||
return <TintableSVG src={require("../../../../res/img/icons-show-stickers.svg")} width="75" height="75" />;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue