Merge pull request #6411 from SimonBrandner/fix/sticker-placeholder/18014

This commit is contained in:
Michael Telatynski 2021-07-20 09:11:28 +01:00 committed by GitHub
commit e11e17eb85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 13 deletions

View file

@ -29,6 +29,10 @@ $timelineImageBorderRadius: 4px;
top: 0; top: 0;
border-radius: $timelineImageBorderRadius; border-radius: $timelineImageBorderRadius;
display: flex;
justify-content: center;
align-items: center;
> canvas { > canvas {
border-radius: $timelineImageBorderRadius; border-radius: $timelineImageBorderRadius;
} }
@ -43,17 +47,6 @@ $timelineImageBorderRadius: 4px;
position: relative; position: relative;
} }
.mx_MImageBody_thumbnail_spinner {
position: absolute;
left: 50%;
top: 50%;
}
// Inner img should be centered around 0, 0
.mx_MImageBody_thumbnail_spinner > * {
transform: translate(-50%, -50%);
}
.mx_MImageBody_gifLabel { .mx_MImageBody_gifLabel {
position: absolute; position: absolute;
display: block; display: block;

View file

@ -440,9 +440,9 @@ export default class MImageBody extends React.Component<IProps, IState> {
protected getPlaceholder(width: number, height: number): JSX.Element { protected getPlaceholder(width: number, height: number): JSX.Element {
const blurhash = this.props.mxEvent.getContent().info[BLURHASH_FIELD]; const blurhash = this.props.mxEvent.getContent().info[BLURHASH_FIELD];
if (blurhash) return <Blurhash hash={blurhash} width={width} height={height} />; if (blurhash) return <Blurhash hash={blurhash} width={width} height={height} />;
return <div className="mx_MImageBody_thumbnail_spinner"> return (
<InlineSpinner w={32} h={32} /> <InlineSpinner w={32} h={32} />
</div>; );
} }
// Overidden by MStickerBody // Overidden by MStickerBody