Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove thumbnail expand icon on PostListing's postTitleLine #1618

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 6 additions & 15 deletions src/shared/components/post/post-listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,26 +482,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
this.postLink
)}
</h5>
{(url && isImage(url)) ||
(post.thumbnail_url && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all that's necessary is to remove the or condition. We do want to show an expando for image posts, just not for link posts.

<button
className="btn btn-sm text-monospace text-muted d-inline-block"
data-tippy-content={I18NextService.i18n.t("expand_here")}
onClick={linkEvent(this, this.handleImageExpandClick)}
>
<Icon
icon={
!this.state.imageExpanded ? "plus-square" : "minus-square"
}
classes="icon-inline"
/>
</button>
))}

{post.removed && (
<small className="ms-2 badge text-bg-secondary">
{I18NextService.i18n.t("removed")}
</small>
)}

{post.deleted && (
<small
className="unselectable pointer ms-2 text-muted fst-italic"
Expand All @@ -510,6 +497,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<Icon icon="trash" classes="icon-inline text-danger" />
</small>
)}

{post.locked && (
<small
className="unselectable pointer ms-2 text-muted fst-italic"
Expand All @@ -518,6 +506,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<Icon icon="lock" classes="icon-inline text-danger" />
</small>
)}

{post.featured_community && (
<small
className="unselectable pointer ms-2 text-muted fst-italic"
Expand All @@ -529,6 +518,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<Icon icon="pin" classes="icon-inline text-primary" />
</small>
)}

{post.featured_local && (
<small
className="unselectable pointer ms-2 text-muted fst-italic"
Expand All @@ -538,6 +528,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<Icon icon="pin" classes="icon-inline text-secondary" />
</small>
)}

{post.nsfw && (
<small className="ms-2 badge text-bg-danger">
{I18NextService.i18n.t("nsfw")}
Expand Down