From 1d20aa0644ab94c1e7d42b0031cd26607a880673 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:31:00 -0400 Subject: [PATCH 01/29] add static width/height for post listing thumbnails --- src/assets/css/main.css | 6 +++--- src/shared/components/post/post-listing.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 63c1b47..e5c163b 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -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 { diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 98c3847..37385a5 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -1433,7 +1433,7 @@ export class PostListing extends Component { )}
-
+
{this.thumbnail()}
From 7fbfa2f0efff27d90999c64c6005e9bee1b47db3 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 19:55:40 -0400 Subject: [PATCH 02/29] Update src/shared/components/post/post-listing.tsx Co-authored-by: Jay Sitter --- src/shared/components/post/post-listing.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 37385a5..e0b484c 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -1433,10 +1433,10 @@ export class PostListing extends Component { )}
-
+
{this.thumbnail()}
-
+
{this.postTitleLine()} {this.createdLine()} {this.commentsLine()} From 3ddff78d88f02e23f3cdafa51ee6119a7f2c2a96 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:01:33 -0400 Subject: [PATCH 03/29] make hopefully final tweaks --- src/assets/css/main.css | 4 ++++ src/shared/components/post/post-listing.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index e5c163b..b999543 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -227,6 +227,10 @@ hr { text-overflow: ellipsis; } +.overflow-hidden { + overflow: hidden; +} + .text-xs-center { text-align: center; } diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index e0b484c..01a78b9 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -333,7 +333,7 @@ export class PostListing extends Component { return (
@@ -969,9 +1013,8 @@ export class PostListing extends Component { get modBanFromCommunityButton() { return ( @@ -981,9 +1024,8 @@ export class PostListing extends Component { get modUnbanFromCommunityButton() { return ( @@ -993,20 +1035,15 @@ export class PostListing extends Component { get addModToCommunityButton() { return ( ); @@ -1015,11 +1052,10 @@ export class PostListing extends Component { get modBanButton() { return ( ); } @@ -1027,14 +1063,13 @@ export class PostListing extends Component { get modUnbanButton() { return ( ); @@ -1043,11 +1078,10 @@ export class PostListing extends Component { get purgePersonButton() { return ( ); } @@ -1055,11 +1089,10 @@ export class PostListing extends Component { get purgePostButton() { return ( ); } @@ -1067,20 +1100,31 @@ export class PostListing extends Component { get toggleAdminButton() { return ( ); } + get transferCommunityButton() { + return ( + + ); + } + get modRemoveButton() { const removed = this.postView.post.removed; return ( @@ -1095,102 +1139,17 @@ export class PostListing extends Component { {this.state.removeLoading ? ( ) : !removed ? ( - I18NextService.i18n.t("remove") + capitalizeFirstLetter(I18NextService.i18n.t("remove_post")) ) : ( - I18NextService.i18n.t("restore") + <> + {capitalizeFirstLetter(I18NextService.i18n.t("restore"))}{" "} + {I18NextService.i18n.t("post")} + )} ); } - /** - * Mod/Admin actions to be taken against the author. - */ - userActionsLine() { - // TODO: make nicer - const post_view = this.postView; - return ( - this.state.showAdvanced && ( -
- {this.canMod_ && ( - <> - {!this.creatorIsMod_ && - (!post_view.creator_banned_from_community - ? this.modBanFromCommunityButton - : this.modUnbanFromCommunityButton)} - {!post_view.creator_banned_from_community && - this.addModToCommunityButton} - - )} - - {/* Community creators and admins can transfer community to another mod */} - {(amCommunityCreator(post_view.creator.id, this.props.moderators) || - this.canAdmin_) && - this.creatorIsMod_ && - (!this.state.showConfirmTransferCommunity ? ( - - ) : ( - <> - - - - - ))} - {/* Admins can ban from all, and appoint other admins */} - {this.canAdmin_ && ( - <> - {!this.creatorIsAdmin_ && ( - <> - {!isBanned(post_view.creator) - ? this.modBanButton - : this.modUnbanButton} - {this.purgePersonButton} - {this.purgePostButton} - - )} - {!isBanned(post_view.creator) && - post_view.creator.local && - this.toggleAdminButton} - - )} -
- ) - ); - } - removeAndBanDialogs() { const post = this.postView; const purgeTypeText = @@ -1218,11 +1177,7 @@ export class PostListing extends Component { value={this.state.removeReason} onInput={linkEvent(this, this.handleModRemoveReasonChange)} /> - )} + {this.state.showConfirmTransferCommunity && ( + <> + + + + + )} {this.state.showBanDialog && (
@@ -1284,11 +1266,7 @@ export class PostListing extends Component { {/* */} {/*
*/}
- )} @@ -1409,7 +1379,6 @@ export class PostListing extends Component { {this.mobileThumbnail()} {this.commentsLine(true)} - {this.userActionsLine()} {this.duplicatesLine()} {this.removeAndBanDialogs()}
@@ -1441,7 +1410,6 @@ export class PostListing extends Component { {this.createdLine()} {this.commentsLine()} {this.duplicatesLine()} - {this.userActionsLine()} {this.removeAndBanDialogs()}
From 38a109ba9215bd161fb9205e162b24a0afb6bcce Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Wed, 28 Jun 2023 22:44:10 -0400 Subject: [PATCH 06/29] Add fixed width/height to `PostListing` thumbnail parent (#1660) * add static width/height for post listing thumbnails * Update src/shared/components/post/post-listing.tsx Co-authored-by: Jay Sitter * make hopefully final tweaks * remove .overflow-hidden --------- Co-authored-by: Jay Sitter Co-authored-by: SleeplessOne1917 --- src/assets/css/main.css | 6 +++--- src/shared/components/post/post-listing.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 63c1b47..e5c163b 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -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 { diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 15b015f..ae6e2f3 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -333,7 +333,7 @@ export class PostListing extends Component { return (