Merge pull request #2274 from urbit/m/link-fe-previews

link fe: properly downscale wide images to fit screen
This commit is contained in:
matildepark 2020-02-11 15:49:55 -05:00 committed by GitHub
commit ffff42d371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,9 +74,8 @@ export class LinkPreview extends Component {
if (imgMatch) { if (imgMatch) {
embed = <a href={props.url} embed = <a href={props.url}
target="_blank" target="_blank"
className="db m0a"
style={{width: "max-content"}}> style={{width: "max-content"}}>
<img src={props.url} style={{maxHeight: "500px", maxWidth: "500px"}}/> <img src={props.url} style={{maxHeight: "500px", maxWidth: "100%"}}/>
</a> </a>
} }
@ -97,7 +96,7 @@ export class LinkPreview extends Component {
return ( return (
<div className="pb6 w-100"> <div className="pb6 w-100">
<div <div
className={"w-100 " + (ytMatch ? "embed-container" : "")}> className={"w-100 tc " + (ytMatch ? "embed-container" : "")}>
{embed} {embed}
</div> </div>
<div className="flex flex-column ml2 pt6"> <div className="flex flex-column ml2 pt6">