Fix centering issue with sticker placeholder (#8404)

This commit is contained in:
Michael Telatynski 2022-04-25 18:36:32 +01:00 committed by GitHub
parent e3735311ab
commit f85e178fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View file

@ -39,11 +39,19 @@ export default class MStickerBody extends MImageBody {
return <div className="mx_MStickerBody_wrapper" onClick={onClick}> { children } </div>;
}
// Placeholder to show in place of the sticker image if
// img onLoad hasn't fired yet.
// Placeholder to show in place of the sticker image if img onLoad hasn't fired yet.
protected getPlaceholder(width: number, height: number): JSX.Element {
if (this.props.mxEvent.getContent().info?.[BLURHASH_FIELD]) return super.getPlaceholder(width, height);
return <img src={require("../../../../res/img/icons-show-stickers.svg").default} width="75" height="75" />;
return (
<img
className="mx_MStickerBody_placeholder"
src={require("../../../../res/img/icons-show-stickers.svg").default}
width="80"
height="80"
onMouseEnter={this.onImageEnter}
onMouseLeave={this.onImageLeave}
/>
);
}
// Tooltip to show on mouse over