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

fix: Fix alignment of preview mini-overlay buttons on thumbs #1630

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/shared/components/post/post-listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,19 @@ export class PostListing extends Component<PostListingProps, PostListingState> {

if (!this.props.hideImage && url && isImage(url) && this.imageSrc) {
return (
<a
href={this.imageSrc}
className="text-body d-inline-block position-relative mb-2"
<button
type="button"
className="d-inline-block position-relative mb-2 p-0 border-0"
data-tippy-content={I18NextService.i18n.t("expand_here")}
onClick={linkEvent(this, this.handleImageExpandClick)}
aria-label={I18NextService.i18n.t("expand_here")}
>
{this.imgThumb(this.imageSrc)}
<Icon icon="image" classes="mini-overlay" />
</a>
<Icon
icon="image"
classes="d-block text-white position-absolute end-0 top-0 mini-overlay text-opacity-75 text-opacity-100-hover"
/>
</button>
);
} else if (!this.props.hideImage && url && thumbnail && this.imageSrc) {
return (
Expand All @@ -351,7 +354,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
title={url}
>
{this.imgThumb(this.imageSrc)}
<Icon icon="external-link" classes="mini-overlay" />
<Icon
icon="external-link"
classes="d-block text-white position-absolute end-0 top-0 mini-overlay text-opacity-75 text-opacity-100-hover"
/>
</a>
);
} else if (url) {
Expand Down