]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/comment/comment-node.tsx
Changing all bigints to numbers
[lemmy-ui.git] / src / shared / components / comment / comment-node.tsx
index 418986d762b496c28e99ca2110e7dadeac894613..d68c5b30695a29bd8ab1c337b2a3eab3d45461c4 100644 (file)
@@ -7,21 +7,19 @@ import {
   BanFromCommunity,
   BanPerson,
   BlockPerson,
-  CommentNode as CommentNodeI,
   CommentReplyView,
   CommentView,
   CommunityModeratorView,
   CreateCommentLike,
   CreateCommentReport,
   DeleteComment,
-  EditComment,
+  DistinguishComment,
   GetComments,
   Language,
-  ListingType,
   MarkCommentReplyAsRead,
   MarkPersonMentionAsRead,
   PersonMentionView,
-  PersonViewSafe,
+  PersonView,
   PurgeComment,
   PurgePerson,
   RemoveComment,
@@ -30,7 +28,12 @@ import {
 } from "lemmy-js-client";
 import moment from "moment";
 import { i18n } from "../../i18next";
-import { BanType, CommentViewType, PurgeType } from "../../interfaces";
+import {
+  BanType,
+  CommentNodeI,
+  CommentViewType,
+  PurgeType,
+} from "../../interfaces";
 import { UserService, WebSocketService } from "../../services";
 import {
   amCommunityCreator,
@@ -91,7 +94,7 @@ interface CommentNodeState {
 interface CommentNodeProps {
   node: CommentNodeI;
   moderators?: CommunityModeratorView[];
-  admins?: PersonViewSafe[];
+  admins?: PersonView[];
   noBorder?: boolean;
   noIndent?: boolean;
   viewOnly?: boolean;
@@ -256,11 +259,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                   {i18n.t("bot_account").toLowerCase()}
                 </div>
               )}
-              {(cv.creator_banned_from_community || isBanned(cv.creator)) && (
-                <div className="badge badge-danger mr-2">
-                  {i18n.t("banned")}
-                </div>
-              )}
               {this.props.showCommunity && (
                 <>
                   <span className="mx-1">{i18n.t("to")}</span>
@@ -296,8 +294,8 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                     <span
                       className="mr-1 font-weight-bold"
                       aria-label={i18n.t("number_of_points", {
-                        count: this.state.score,
-                        formattedCount: this.state.score,
+                        count: Number(this.state.score),
+                        formattedCount: numToSI(this.state.score),
                       })}
                     >
                       {numToSI(this.state.score)}
@@ -430,7 +428,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                               <button className="btn btn-link btn-animate">
                                 <Link
                                   className="text-muted"
-                                  to={`/create_private_message/recipient/${cv.creator.id}`}
+                                  to={`/create_private_message/${cv.creator.id}`}
                                   title={i18n.t("message").toLowerCase()}
                                 >
                                   <Icon icon="mail" />
@@ -1278,7 +1276,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     let comment = i.props.node.comment_view.comment;
     let auth = myAuth();
     if (auth) {
-      let form: EditComment = {
+      let form: DistinguishComment = {
         comment_id: comment.id,
         distinguished: !comment.distinguished,
         auth,
@@ -1543,7 +1541,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
       parent_id: i.props.node.comment_view.comment.id,
       max_depth: commentTreeMaxDepth,
       limit: 999, // TODO
-      type_: ListingType.All,
+      type_: "All",
       saved_only: false,
       auth: myAuth(false),
     };
@@ -1563,18 +1561,18 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
 
   get pointsTippy(): string {
     let points = i18n.t("number_of_points", {
-      count: this.state.score,
-      formattedCount: this.state.score,
+      count: Number(this.state.score),
+      formattedCount: numToSI(this.state.score),
     });
 
     let upvotes = i18n.t("number_of_upvotes", {
-      count: this.state.upvotes,
-      formattedCount: this.state.upvotes,
+      count: Number(this.state.upvotes),
+      formattedCount: numToSI(this.state.upvotes),
     });
 
     let downvotes = i18n.t("number_of_downvotes", {
-      count: this.state.downvotes,
-      formattedCount: this.state.downvotes,
+      count: Number(this.state.downvotes),
+      formattedCount: numToSI(this.state.downvotes),
     });
 
     return `${points} • ${upvotes} • ${downvotes}`;