fixed stretched images

This commit is contained in:
Martina 2020-11-11 13:13:40 -08:00
parent e7b5fbc17d
commit 583593bea2

View File

@ -19,7 +19,6 @@ const STYLES_IMAGE_CONTAINER = css`
const STYLES_IMAGE = css` const STYLES_IMAGE = css`
background-color: ${Constants.system.foreground}; background-color: ${Constants.system.foreground};
display: block; display: block;
width: 100%;
pointer-events: none; pointer-events: none;
transition: 200ms ease all; transition: 200ms ease all;
`; `;
@ -155,7 +154,7 @@ export default class SlateMediaObjectPreview extends React.Component {
) : this.state.showImage ? ( ) : this.state.showImage ? (
<img <img
css={STYLES_IMAGE} css={STYLES_IMAGE}
style={{ maxHeight: "100%", ...this.props.imageStyle }} style={{ maxHeight: "100%", maxWidth: "100%", ...this.props.imageStyle }}
src={url} src={url}
/> />
) : blurhash ? ( ) : blurhash ? (
@ -171,7 +170,10 @@ export default class SlateMediaObjectPreview extends React.Component {
punch={1} punch={1}
/> />
) : ( ) : (
<div css={STYLES_IMAGE} style={{ maxHeight: "100%", ...this.props.imageStyle }} /> <div
css={STYLES_IMAGE}
style={{ maxHeight: "100%", maxWidth: "100%", ...this.props.imageStyle }}
/>
)} )}
</React.Fragment> </React.Fragment>
); );