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

Commit 5793f55

Browse files
authored
Merge pull request #5677 from matrix-org/jryans/revert-url-image-layout
Revert "Improve URL preview formatting and image upload thumbnail size"
2 parents 72ff919 + 3db6a45 commit 5793f55

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

res/css/views/messages/_MVideoBody.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
span.mx_MVideoBody {
1818
video.mx_MVideoBody {
1919
max-width: 100%;
20-
max-height: 300px;
20+
height: auto;
2121
border-radius: 4px;
2222
}
2323
}

res/css/views/rooms/_LinkPreviewWidget.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ limitations under the License.
1919
margin-right: 15px;
2020
margin-bottom: 15px;
2121
display: flex;
22-
flex-direction: column;
23-
max-width: 360px;
2422
border-left: 4px solid $preview-widget-bar-color;
2523
color: $preview-widget-fg-color;
2624
}
@@ -57,9 +55,6 @@ limitations under the License.
5755
cursor: pointer;
5856
width: 18px;
5957
height: 18px;
60-
padding: 0px 5px 5px 5px;
61-
margin-left: auto;
62-
margin-right: 0px;
6358

6459
img {
6560
flex: 0 0 40px;

src/components/views/messages/MImageBody.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export default class MImageBody extends React.Component {
362362
}
363363

364364
// The maximum height of the thumbnail as it is rendered as an <img>
365-
const maxHeight = Math.min(this.props.maxImageHeight || 240, infoHeight);
365+
const maxHeight = Math.min(this.props.maxImageHeight || 600, infoHeight);
366366
// The maximum width of the thumbnail, as dictated by its natural
367367
// maximum height.
368368
const maxWidth = infoWidth * maxHeight / infoHeight;

src/components/views/rooms/LinkPreviewWidget.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class LinkPreviewWidget extends React.Component {
107107
if (!SettingsStore.getValue("showImages")) {
108108
image = null; // Don't render a button to show the image, just hide it outright
109109
}
110-
const imageMaxWidth = 320; const imageMaxHeight = 240;
110+
const imageMaxWidth = 100; const imageMaxHeight = 100;
111111
if (image && image.startsWith("mxc://")) {
112112
image = MatrixClientPeg.get().mxcUrlToHttp(image, imageMaxWidth, imageMaxHeight);
113113
}
@@ -134,10 +134,6 @@ export default class LinkPreviewWidget extends React.Component {
134134
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
135135
return (
136136
<div className="mx_LinkPreviewWidget">
137-
<AccessibleButton className="mx_LinkPreviewWidget_cancel" onClick={this.props.onCancelClick} aria-label={_t("Close preview")}>
138-
<img className="mx_filterFlipColor" alt="" role="presentation"
139-
src={require("../../../../res/img/cancel.svg")} width="18" height="18" />
140-
</AccessibleButton>
141137
{ img }
142138
<div className="mx_LinkPreviewWidget_caption">
143139
<div className="mx_LinkPreviewWidget_title"><a href={this.props.link} target="_blank" rel="noreferrer noopener">{ p["og:title"] }</a></div>
@@ -146,6 +142,10 @@ export default class LinkPreviewWidget extends React.Component {
146142
{ description }
147143
</div>
148144
</div>
145+
<AccessibleButton className="mx_LinkPreviewWidget_cancel" onClick={this.props.onCancelClick} aria-label={_t("Close preview")}>
146+
<img className="mx_filterFlipColor" alt="" role="presentation"
147+
src={require("../../../../res/img/cancel.svg")} width="18" height="18" />
148+
</AccessibleButton>
149149
</div>
150150
);
151151
}

0 commit comments

Comments
 (0)