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

Fix sticker placeholder centering #6411

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions res/css/views/messages/_MImageBody.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ $timelineImageBorderRadius: 4px;
top: 0;
border-radius: $timelineImageBorderRadius;

display: flex;
justify-content: center;
align-items: center;

> canvas {
border-radius: $timelineImageBorderRadius;
}
Expand All @@ -43,17 +47,6 @@ $timelineImageBorderRadius: 4px;
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 {
position: absolute;
display: block;
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/messages/MImageBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ export default class MImageBody extends React.Component<IProps, IState> {
protected getPlaceholder(width: number, height: number): JSX.Element {
const blurhash = this.props.mxEvent.getContent().info[BLURHASH_FIELD];
if (blurhash) return <Blurhash hash={blurhash} width={width} height={height} />;
return <div className="mx_MImageBody_thumbnail_spinner">
return (
<InlineSpinner w={32} h={32} />
</div>;
);
}

// Overidden by MStickerBody
Expand Down