Skip to content

Commit

Permalink
Merge pull request #492 from whtsupbab3/center-100-percent-value-in-v…
Browse files Browse the repository at this point in the history
…oting

Center 100% value in voting
  • Loading branch information
picsoritdidnthappen authored Jan 20, 2025
2 parents 8a90970 + 512307e commit c0db957
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/bounty/Voting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,20 @@ export default function Voting({
fill='#FFF'
style={{ fontSize: '3.5px', pointerEvents: 'none' }}
>
<tspan x={x} y={y} dx={dx} dy={dy}>
<tspan
x={x}
y={y}
dx={dataEntry.percentage === 100 ? 0 : dx}
dy={dataEntry.percentage === 100 ? 0 : dy}
>
{Math.round(dataEntry.percentage)}%
</tspan>
<tspan x={x} y={y + 3} dx={dx} dy={dy}>
<tspan
x={x}
y={y + 3}
dx={dataEntry.percentage === 100 ? 0 : dx}
dy={dataEntry.percentage === 100 ? 0 : dy}
>
{dataEntry.title}
</tspan>
</text>
Expand Down

0 comments on commit c0db957

Please sign in to comment.