Move inline style to stylesheet

pull/21833/head
Luke Barnard 2018-05-18 11:33:33 +01:00
parent 6699c4faed
commit 015093b371
2 changed files with 12 additions and 8 deletions

View File

@ -35,3 +35,13 @@ limitations under the License.
// Make sure the _thumbnail is positioned relative to the _container
position: relative;
}
.mx_MImageBody_thumbnail_spinner {
display: flex;
align-items: center;
width: 100%;
}
.mx_MImageBody_thumbnail_spinner img {
margin: auto;
}

View File

@ -239,14 +239,8 @@ export default class extends React.Component {
let img = null;
// e2e image hasn't been decrypted yet
if (content.file !== undefined && this.state.decryptedUrl === null) {
img = <div className="mx_MImageBody_thumbnail" ref="image" style={{
"display": "flex",
"alignItems": "center",
"width": "100%",
}}>
<img src="img/spinner.gif" alt={content.body} width="32" height="32" style={{
"margin": "auto",
}} />
img = <div className="mx_MImageBody_thumbnail mx_MImageBody_thumbnail_spinner" ref="image">
<img src="img/spinner.gif" alt={content.body} width="32" height="32" />
</div>;
} else if (thumbUrl && !this.state.imgError) {
// Restrict the width of the thumbnail here, otherwise it will fill the container