fix total rewards

This commit is contained in:
keyan 2024-04-01 09:05:39 -05:00
parent 302f5b5dfc
commit 10a08f28f3
1 changed files with 3 additions and 2 deletions

View File

@ -99,16 +99,17 @@ export default function Rewards ({ ssrData }) {
let { rewards: [{ total, sources, time, leaderboard }] } = useData(data, ssrData)
if (rewardsData?.rewards?.length > 0) {
total = rewardsData.rewards[0].total - 1000000 > 0 ? rewardsData.rewards[0].total - 1000000 : 0
total = rewardsData.rewards[0].total
sources = rewardsData.rewards[0].sources
time = rewardsData.rewards[0].time
}
function EstimatedReward ({ rank }) {
const totalRest = total - 1000000
return (
<div className='text-muted fst-italic'>
<small>
<span>estimated reward: {numWithUnits(rank === 1 ? 1000000 : Math.floor(total * proportions[rank - 2]))}</span>
<span>estimated reward: {numWithUnits(rank === 1 ? 1000000 : Math.floor(totalRest * proportions[rank - 2]))}</span>
</small>
</div>
)