From 528aed7f58b74c73bf4187839b7cbf0e90d78267 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sun, 25 Jun 2023 16:33:11 -0400 Subject: [PATCH 1/3] feat(UI): Hide avatars on listings --- src/shared/components/post/post-listing.tsx | 11 +++++++++-- src/shared/components/post/post-listings.tsx | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 76a3e445..a27d8334 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -106,6 +106,7 @@ interface PostListingProps { siteLanguages: number[]; showCommunity?: boolean; showBody?: boolean; + hideAvatars?: boolean; hideImage?: boolean; enableDownvotes?: boolean; enableNsfw?: boolean; @@ -397,7 +398,10 @@ export class PostListing extends Component { const post_view = this.postView; return ( - + {this.creatorIsMod_ && ( {I18NextService.i18n.t("mod")} @@ -417,7 +421,10 @@ export class PostListing extends Component { <> {" "} {I18NextService.i18n.t("to")}{" "} - + )} {post_view.post.language_id !== 0 && ( diff --git a/src/shared/components/post/post-listings.tsx b/src/shared/components/post/post-listings.tsx index 1fdaeba2..29bbf588 100644 --- a/src/shared/components/post/post-listings.tsx +++ b/src/shared/components/post/post-listings.tsx @@ -76,6 +76,7 @@ export class PostListings extends Component { showCommunity={this.props.showCommunity} enableDownvotes={this.props.enableDownvotes} enableNsfw={this.props.enableNsfw} + hideAvatars={true} viewOnly={this.props.viewOnly} allLanguages={this.props.allLanguages} siteLanguages={this.props.siteLanguages} From f57bf3bb8b1fb6bf1ec8cad57668af25e1a4ba16 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Mon, 26 Jun 2023 18:07:10 -0400 Subject: [PATCH 2/3] fix: Restore icon avatars; make smaller and roundrect --- src/assets/css/main.css | 5 +++-- src/shared/components/common/pictrs-image.tsx | 2 +- src/shared/components/post/post-listing.tsx | 12 +++--------- src/shared/components/post/post-listings.tsx | 1 - 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index b917b3ec..41ec231b 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -360,8 +360,9 @@ br.big { } .img-icon { - width: 2rem; - height: 2rem; + width: calc(var(--bs-body-line-height) * 1em); + height: calc(var(--bs-body-line-height) * 1em); + border-radius: 0.25em; } .tribute-container ul { diff --git a/src/shared/components/common/pictrs-image.tsx b/src/shared/components/common/pictrs-image.tsx index 31fb1229..9c14aefc 100644 --- a/src/shared/components/common/pictrs-image.tsx +++ b/src/shared/components/common/pictrs-image.tsx @@ -39,7 +39,7 @@ export class PictrsImage extends Component { "img-expanded slight-radius": !this.props.thumbnail && !this.props.icon, "img-blur": this.props.thumbnail && this.props.nsfw, - "rounded-circle img-cover img-icon me-2": this.props.icon, + "img-cover img-icon me-1": this.props.icon, "ms-2 mb-0 rounded-circle img-cover avatar-overlay": this.props.iconOverlay, "avatar-pushup": this.props.pushup, diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 3883b9a1..a7064f05 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -106,7 +106,7 @@ interface PostListingProps { siteLanguages: number[]; showCommunity?: boolean; showBody?: boolean; - hideAvatars?: boolean; + smallAvatars?: boolean; hideImage?: boolean; enableDownvotes?: boolean; enableNsfw?: boolean; @@ -398,10 +398,7 @@ export class PostListing extends Component { const post_view = this.postView; return ( - + {this.creatorIsMod_ && ( {I18NextService.i18n.t("mod")} @@ -421,10 +418,7 @@ export class PostListing extends Component { <> {" "} {I18NextService.i18n.t("to")}{" "} - + )} {post_view.post.language_id !== 0 && ( diff --git a/src/shared/components/post/post-listings.tsx b/src/shared/components/post/post-listings.tsx index 29bbf588..1fdaeba2 100644 --- a/src/shared/components/post/post-listings.tsx +++ b/src/shared/components/post/post-listings.tsx @@ -76,7 +76,6 @@ export class PostListings extends Component { showCommunity={this.props.showCommunity} enableDownvotes={this.props.enableDownvotes} enableNsfw={this.props.enableNsfw} - hideAvatars={true} viewOnly={this.props.viewOnly} allLanguages={this.props.allLanguages} siteLanguages={this.props.siteLanguages} From 319bb4116fb7052c4218a6e95df43cf68e032084 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Mon, 26 Jun 2023 19:46:29 -0400 Subject: [PATCH 3/3] fix: Remove smallavatars prop --- src/shared/components/post/post-listing.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index a7064f05..8c537678 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -106,7 +106,6 @@ interface PostListingProps { siteLanguages: number[]; showCommunity?: boolean; showBody?: boolean; - smallAvatars?: boolean; hideImage?: boolean; enableDownvotes?: boolean; enableNsfw?: boolean;