Add fixed width/height to `PostListing` thumbnail parent (#1660)
authorAlec Armbruster <35377827+alectrocute@users.noreply.github.com>
Thu, 29 Jun 2023 02:44:10 +0000 (22:44 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Jun 2023 02:44:10 +0000 (22:44 -0400)
* add static width/height for post listing thumbnails

* Update src/shared/components/post/post-listing.tsx

Co-authored-by: Jay Sitter <jsit@users.noreply.github.com>
* make hopefully final tweaks

* remove .overflow-hidden

---------

Co-authored-by: Jay Sitter <jsit@users.noreply.github.com>
Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
src/assets/css/main.css
src/shared/components/post/post-listing.tsx

index 63c1b47121defb9bd1a0fcb14a1c59839ff0aa8c..e5c163b1b540e1d4978c6ce68ed12da7ca036aa1 100644 (file)
@@ -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 {
index 15b015f750bcefbda573710dbf544a2460789344..ae6e2f3b7acd361daddda4a904fb3499157c15aa 100644 (file)
@@ -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")}
@@ -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}
@@ -1402,10 +1402,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()}