From 8e711c6b543f3ce75638d9adcc089d15d5f7e4e3 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Wed, 21 Jun 2023 19:24:01 -0400 Subject: [PATCH 1/2] fix: Fix i18n UserService import issue --- src/shared/i18next.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index ff5f77f1..aab43014 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -1,6 +1,6 @@ import { isBrowser } from "@utils/browser"; import i18next, { i18nTyped, Resource } from "i18next"; -import { UserService } from "./services"; +import { UserService } from "./services/UserService"; import { ar } from "./translations/ar"; import { bg } from "./translations/bg"; import { ca } from "./translations/ca"; From bf0f80e798b38ee748c0a98ba844d83eac7057b9 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Wed, 21 Jun 2023 19:40:24 -0400 Subject: [PATCH 2/2] fix: Add post body preview to desktop post listing view --- src/shared/components/post/post-listing.tsx | 76 +++++++++------------ 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 46a31ba6..3c271659 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -360,28 +360,25 @@ export class PostListing extends Component { createdLine() { const post_view = this.postView; return ( -
    -
  • - - - {this.creatorIsMod_ && ( - {i18n.t("mod")} - )} - {this.creatorIsAdmin_ && ( - {i18n.t("admin")} - )} - {post_view.creator.bot_account && ( - - {i18n.t("bot_account").toLowerCase()} - - )} - {this.props.showCommunity && ( - <> - {" "} - {i18n.t("to")} - - )} -
  • + + + {this.creatorIsMod_ && ( + {i18n.t("mod")} + )} + {this.creatorIsAdmin_ && ( + {i18n.t("admin")} + )} + {post_view.creator.bot_account && ( + + {i18n.t("bot_account").toLowerCase()} + + )} + {this.props.showCommunity && ( + <> + {" "} + {i18n.t("to")} + + )} {post_view.post.language_id !== 0 && ( { @@ -390,17 +387,13 @@ export class PostListing extends Component { )?.name } - )} -
  • -
  • - - - -
  • -
+ )}{" "} + •{" "} + + ); } @@ -737,10 +730,8 @@ export class PostListing extends Component { to={`/post/${post_view.post.id}?scrollToComments=true`} data-tippy-content={title} > - - - {post_view.counts.comments} - + + {post_view.counts.comments} {this.unreadCount && ( ({this.unreadCount} {i18n.t("new")}) @@ -1068,7 +1059,7 @@ export class PostListing extends Component { const post_view = this.postView; return ( this.state.showAdvanced && ( - <> +
{this.canMod_ && ( <> {!this.creatorIsMod_ && @@ -1221,7 +1212,7 @@ export class PostListing extends Component { )} )} - +
) ); } @@ -1408,11 +1399,11 @@ export class PostListing extends Component { ); } - showMobilePreview() { + showBodyPreview() { const { body, id } = this.postView.post; return !this.showBody && body ? ( - +
{body}
) : ( @@ -1433,7 +1424,7 @@ export class PostListing extends Component { {this.mobileThumbnail()} {/* Show a preview of the post body */} - {this.showMobilePreview()} + {this.showBodyPreview()} {this.commentsLine(true)} {this.userActionsLine()} @@ -1455,6 +1446,7 @@ export class PostListing extends Component {
{this.postTitleLine()} {this.createdLine()} + {this.showBodyPreview()} {this.commentsLine()} {this.duplicatesLine()} {this.userActionsLine()}