mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-25 18:36:24 +00:00
parent
765ed9549a
commit
36c1c1f262
|
@ -448,13 +448,27 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get postLink() {
|
||||||
|
let post = this.props.post_view.post;
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
className={!post.stickied ? "text-body" : "text-primary"}
|
||||||
|
to={`/post/${post.id}`}
|
||||||
|
title={i18n.t("comments")}
|
||||||
|
>
|
||||||
|
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
postTitleLine() {
|
postTitleLine() {
|
||||||
let post = this.props.post_view.post;
|
let post = this.props.post_view.post;
|
||||||
return (
|
return (
|
||||||
<div className="post-title overflow-hidden">
|
<div className="post-title overflow-hidden">
|
||||||
<h5>
|
<h5>
|
||||||
{post.url.match({
|
{post.url.match({
|
||||||
some: url => (
|
some: url =>
|
||||||
|
this.props.showBody ? (
|
||||||
<a
|
<a
|
||||||
className={!post.stickied ? "text-body" : "text-primary"}
|
className={!post.stickied ? "text-body" : "text-primary"}
|
||||||
href={url}
|
href={url}
|
||||||
|
@ -463,16 +477,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
>
|
>
|
||||||
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
|
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
|
||||||
</a>
|
</a>
|
||||||
|
) : (
|
||||||
|
this.postLink
|
||||||
),
|
),
|
||||||
none: (
|
none: this.postLink,
|
||||||
<Link
|
|
||||||
className={!post.stickied ? "text-body" : "text-primary"}
|
|
||||||
to={`/post/${post.id}`}
|
|
||||||
title={i18n.t("comments")}
|
|
||||||
>
|
|
||||||
<div dangerouslySetInnerHTML={mdToHtmlInline(post.name)} />
|
|
||||||
</Link>
|
|
||||||
),
|
|
||||||
})}
|
})}
|
||||||
{post.url.map(isImage).or(post.thumbnail_url).unwrapOr(false) && (
|
{post.url.map(isImage).or(post.thumbnail_url).unwrapOr(false) && (
|
||||||
<button
|
<button
|
||||||
|
|
Loading…
Reference in a new issue