Merge pull request #6342 from matrix-org/t3chguy/fix/vrlp

Fix small visual regression with the site name on url previews
pull/21833/head
Michael Telatynski 2021-07-09 18:05:48 +01:00 committed by GitHub
commit 829169ec87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -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 {

View File

@ -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>