Unverified Commit 5a841383 authored by Harrison Healey's avatar Harrison Healey Committed by GitHub

MM-13268 Fix dimensions of webhook images (5.7) (#2197)

* MM-13268 Fix dimensions of webhook images (5.7)

* Update snapshots
parent 650427f8
......@@ -73,12 +73,16 @@ exports[`components/post_view/MessageAttachment should call actions.doPostAction
message="short text"
/>
</Connect(ShowMore)>
<img
className="attachment__image"
height={200}
src="image_url"
width={200}
/>
<div
className="attachment__image-container"
>
<img
className="attachment__image"
height={200}
src="image_url"
width={200}
/>
</div>
<div
className="attachment-actions"
>
......@@ -189,12 +193,16 @@ exports[`components/post_view/MessageAttachment should match snapshot 1`] = `
message="short text"
/>
</Connect(ShowMore)>
<img
className="attachment__image"
height={200}
src="image_url"
width={200}
/>
<div
className="attachment__image-container"
>
<img
className="attachment__image"
height={200}
src="image_url"
width={200}
/>
</div>
</div>
<div
className="attachment__thumb-container"
......
......@@ -313,11 +313,13 @@ export default class MessageAttachment extends React.PureComponent {
if (attachment.image_url) {
const imageDimensions = getFileDimensionsForDisplay(this.props.imagesMetadata[attachment.image_url], MAX_DIMENSIONS_IMAGE_URL);
image = (
<img
className='attachment__image'
src={attachment.image_url}
{...imageDimensions}
/>
<div className='attachment__image-container'>
<img
className='attachment__image'
src={attachment.image_url}
{...imageDimensions}
/>
</div>
);
}
......
......@@ -206,10 +206,13 @@
width: 95px;
}
.attachment__image-container {
max-width: 500px;
}
.attachment__image {
margin-bottom: 1em;
max-height: 300px;
max-width: 500px;
border: 1px solid transparent;
&.attachment__image--opengraph {
......@@ -324,4 +327,4 @@
}
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment