mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 12:21:13 +00:00
wip
This commit is contained in:
parent
ad6db69dda
commit
bd69d941f1
1 changed files with 47 additions and 35 deletions
|
@ -325,10 +325,11 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
}
|
||||
|
||||
thumbnail() {
|
||||
const post = this.postView.post;
|
||||
const url = post.url;
|
||||
const { post } = this.postView;
|
||||
const { url } = post;
|
||||
const thumbnail = post.thumbnail_url;
|
||||
|
||||
// if direct image link
|
||||
if (!this.props.hideImage && url && isImage(url) && this.imageSrc) {
|
||||
return (
|
||||
<button
|
||||
|
@ -345,7 +346,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
/>
|
||||
</button>
|
||||
);
|
||||
} else if (!this.props.hideImage && url && thumbnail && this.imageSrc) {
|
||||
}
|
||||
|
||||
// if link to url with included metadata image
|
||||
if (!this.props.hideImage && url && thumbnail && this.imageSrc) {
|
||||
return (
|
||||
<a
|
||||
className="thumbnail rounded overflow-hidden d-inline-block position-relative p-0 border-0"
|
||||
|
@ -360,8 +364,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
/>
|
||||
</a>
|
||||
);
|
||||
} else if (url) {
|
||||
if ((!this.props.hideImage && isVideo(url)) || post.embed_video_url) {
|
||||
}
|
||||
|
||||
// if link to direct/embedded video
|
||||
if (
|
||||
url &&
|
||||
((!this.props.hideImage && isVideo(url)) || post.embed_video_url)
|
||||
) {
|
||||
return (
|
||||
<a
|
||||
className="text-body"
|
||||
|
@ -377,7 +386,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
</div>
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
}
|
||||
|
||||
// if link to url without metadata image
|
||||
if (url) {
|
||||
return (
|
||||
<a className="text-body" href={url} title={url} rel={relTags}>
|
||||
<div className="thumbnail rounded bg-light d-flex justify-content-center">
|
||||
|
@ -386,7 +398,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
</a>
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
// if text-only post
|
||||
return (
|
||||
<Link
|
||||
className="text-body"
|
||||
|
@ -399,7 +412,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
</Link>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
createdLine() {
|
||||
const post_view = this.postView;
|
||||
|
|
Loading…
Reference in a new issue