fix: Only post title should be inside h5, not the additional metadata icons

This commit is contained in:
Jay Sitter 2023-06-17 12:32:12 -04:00
parent dcf576ff41
commit fbd2b727cb

View file

@ -519,30 +519,23 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
return ( return (
<div className="post-title overflow-hidden"> <div className="post-title overflow-hidden">
<h5> <h5 className="d-inline">
{url ? ( {url && this.props.showBody ? (
this.props.showBody ? (
<a <a
className={`d-inline-block ${ className={
!post.featured_community && !post.featured_local !post.featured_community && !post.featured_local
? "text-body" ? "text-body"
: "text-primary" : "text-primary"
}`} }
href={url} href={url}
title={url} title={url}
rel={relTags} rel={relTags}
>
<div
className="d-inline-block"
dangerouslySetInnerHTML={mdToHtmlInline(post.name)} dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
/> ></a>
</a>
) : (
this.postLink
)
) : ( ) : (
this.postLink this.postLink
)} )}
</h5>
{(url && isImage(url)) || {(url && isImage(url)) ||
(post.thumbnail_url && ( (post.thumbnail_url && (
<button <button
@ -582,8 +575,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
{post.featured_community && ( {post.featured_community && (
<small <small
className="unselectable pointer ml-2 text-muted font-italic" className="unselectable pointer ml-2 text-muted font-italic"
aria-label={i18n.t("featured_in_community")}
data-tippy-content={i18n.t("featured_in_community")} data-tippy-content={i18n.t("featured_in_community")}
aria-label={i18n.t("featured_in_community")}
> >
<Icon icon="pin" classes="icon-inline text-primary" /> <Icon icon="pin" classes="icon-inline text-primary" />
</small> </small>
@ -591,8 +584,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
{post.featured_local && ( {post.featured_local && (
<small <small
className="unselectable pointer ml-2 text-muted font-italic" className="unselectable pointer ml-2 text-muted font-italic"
aria-label={i18n.t("featured_in_local")}
data-tippy-content={i18n.t("featured_in_local")} data-tippy-content={i18n.t("featured_in_local")}
aria-label={i18n.t("featured_in_local")}
> >
<Icon icon="pin" classes="icon-inline text-secondary" /> <Icon icon="pin" classes="icon-inline text-secondary" />
</small> </small>
@ -602,7 +595,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
{i18n.t("nsfw")} {i18n.t("nsfw")}
</small> </small>
)} )}
</h5>
</div> </div>
); );
} }