Skip to content

Commit

Permalink
Merge pull request matrix-org#6342 from matrix-org/t3chguy/fix/vrlp
Browse files Browse the repository at this point in the history
Fix small visual regression with the site name on url previews
  • Loading branch information
t3chguy authored Jul 9, 2021
2 parents e9600e9 + 8072007 commit 829169e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions res/css/views/rooms/_LinkPreviewWidget.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ limitations under the License.
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.mx_LinkPreviewWidget_siteName {
display: inline;
.mx_LinkPreviewWidget_siteName {
font-weight: normal;
}
}

.mx_LinkPreviewWidget_description {
Expand Down
8 changes: 6 additions & 2 deletions src/components/views/rooms/LinkPreviewWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ export default class LinkPreviewWidget extends React.Component<IProps, IState> {
<div className="mx_LinkPreviewWidget">
{ img }
<div className="mx_LinkPreviewWidget_caption">
<div className="mx_LinkPreviewWidget_title"><a href={this.props.link} target="_blank" rel="noreferrer noopener">{ p["og:title"] }</a></div>
<div className="mx_LinkPreviewWidget_siteName">{ p["og:site_name"] ? (" - " + p["og:site_name"]) : null }</div>
<div className="mx_LinkPreviewWidget_title">
<a href={this.props.link} target="_blank" rel="noreferrer noopener">{ p["og:title"] }</a>
{ p["og:site_name"] && <span className="mx_LinkPreviewWidget_siteName">
{ (" - " + p["og:site_name"]) }
</span> }
</div>
<div className="mx_LinkPreviewWidget_description" ref={this.description}>
{ description }
</div>
Expand Down

0 comments on commit 829169e

Please sign in to comment.