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

Add fixed width/height to PostListing thumbnail parent #1660

Merged
merged 7 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ blockquote {

.thumbnail {
object-fit: cover;
aspect-ratio: 4/3;
width: 100%;
max-height: 6rem;
aspect-ratio: 1/1;
width: 5rem;
height: 5rem;
}

.thumbnail svg {
Expand Down
8 changes: 4 additions & 4 deletions src/shared/components/post/post-listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
return (
<button
type="button"
className="d-inline-block position-relative mb-2 p-0 border-0"
className="thumbnail rounded overflow-hidden 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")}
Expand All @@ -348,7 +348,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
} else if (!this.props.hideImage && url && thumbnail && this.imageSrc) {
return (
<a
className="text-body d-inline-block position-relative mb-2"
className="thumbnail rounded bg-light d-flex justify-content-center"
href={url}
rel={relTags}
title={url}
Expand Down Expand Up @@ -1433,10 +1433,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
)}
<div className="col flex-grow-1">
<div className="row">
<div className="col-sm-3 col-lg-2 pe-0 post-media">
<div className="col flex-grow-0 px-0">
<div className="">{this.thumbnail()}</div>
</div>
<div className="col-12 col-sm-9 col-lg-10">
<div className="col flex-grow-1">
{this.postTitleLine()}
{this.createdLine()}
{this.commentsLine()}
Expand Down