From 787a75396be6132a9a2e3b427d8013d56a2f7c79 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Fri, 23 Jun 2023 00:15:24 -0400 Subject: [PATCH] fix!: Try to get Vote Buttons component working in Comments --- .../components/comment/comment-node.tsx | 113 +++--------------- src/shared/components/common/vote-buttons.tsx | 6 +- 2 files changed, 21 insertions(+), 98 deletions(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index b558d14..d38a7af 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -3,7 +3,6 @@ import { getCommentParentId, myAuth, myAuthRequired, - newVote, showScores, } from "@utils/app"; import { futureDaysToUnixTime, numToSI } from "@utils/helpers"; @@ -53,13 +52,13 @@ import { CommentNodeI, CommentViewType, PurgeType, - VoteType, } from "../../interfaces"; import { mdToHtml, mdToHtmlNoImages } from "../../markdown"; import { I18NextService, UserService } from "../../services"; import { setupTippy } from "../../tippy"; import { Icon, PurgeWarning, Spinner } from "../common/icon"; import { MomentTime } from "../common/moment-time"; +import { VoteButtonsCompact } from "../common/vote-buttons"; import { CommunityLink } from "../community/community-link"; import { PersonListing } from "../person/person-listing"; import { CommentForm } from "./comment-form"; @@ -280,7 +279,7 @@ export class CommentNode extends Component { node.comment_view.counts.child_count > 0; return ( -
  • +
  • { )} {/* This is an expanding spacer for mobile */}
    + {showScores() && ( <> - - {this.state.upvoteLoading ? ( - - ) : ( - - {numToSI(this.commentView.counts.score)} - - )} - + {numToSI(this.commentView.counts.score)} + • )} @@ -448,60 +436,13 @@ export class CommentNode extends Component { )} {UserService.Instance.myUserInfo && !this.props.viewOnly && ( <> - - {this.props.enableDownvotes && ( - - )} +