From 111dc0a6d0c498e57a217e292f6ed8246b4924be Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 19 Aug 2024 12:54:56 +0100 Subject: [PATCH] Hide downvote counts --- .../Projects/ListProjectSolutions.tsx | 3 ++- src/components/Projects/VoteButton.tsx | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/Projects/ListProjectSolutions.tsx b/src/components/Projects/ListProjectSolutions.tsx index 28542a88f..f4dfa95f1 100644 --- a/src/components/Projects/ListProjectSolutions.tsx +++ b/src/components/Projects/ListProjectSolutions.tsx @@ -268,7 +268,7 @@ export function ListProjectSolutions(props: ListProjectSolutionsProps) {
- + { handleSubmitVote(solution._id!, 'downvote'); }} diff --git a/src/components/Projects/VoteButton.tsx b/src/components/Projects/VoteButton.tsx index 3b047ae79..15feb7254 100644 --- a/src/components/Projects/VoteButton.tsx +++ b/src/components/Projects/VoteButton.tsx @@ -5,14 +5,15 @@ type VoteButtonProps = { icon: LucideIcon; isActive: boolean; count: number; + hideCount?: boolean; onClick: () => void; }; export function VoteButton(props: VoteButtonProps) { - const { icon: VoteIcon, isActive, count, onClick } = props; + const { icon: VoteIcon, isActive, hideCount = false, count, onClick } = props; return ( ); }