Fix small visual regression with the site name on url previews

This commit is contained in:
Michael Telatynski 2021-07-09 14:50:55 +01:00
parent ac309a0d08
commit 8072007782
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>