Skip to content

Commit

Permalink
clients/Issue: count all positive reactions as thumbs up
Browse files Browse the repository at this point in the history
  • Loading branch information
zegl committed Dec 11, 2023
1 parent 194011c commit e5bc2fc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clients/packages/polarkit/src/components/Issue/IssueSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ const IssueSummary: React.FC<IssueSummaryProps> = ({
const closedAt = issue_closed_at ? new Date(issue_closed_at) : undefined

const showCommentsCount = !!(comments && comments > 0)
const showReactionsThumbs = !!(reactions && reactions.plus_one > 0)

const positiveReactions = reactions
? reactions.plus_one +
reactions.heart +
reactions.hooray +
reactions.laugh +
reactions.rocket
: 0
const showReactionsThumbs = positiveReactions > 0

const markdownTitle = generateMarkdownTitle(title)

Expand Down Expand Up @@ -119,7 +127,7 @@ const IssueSummary: React.FC<IssueSummaryProps> = ({
<IconCounter icon="comments" count={comments} />
)}
{showReactionsThumbs && reactions && (
<IconCounter icon="thumbs_up" count={reactions.plus_one} />
<IconCounter icon="thumbs_up" count={positiveReactions} />
)}
</div>

Expand Down

0 comments on commit e5bc2fc

Please sign in to comment.