fix total rewards

This commit is contained in:
keyan 2024-04-01 09:05:39 -05:00
parent 302f5b5dfc
commit 10a08f28f3

View File

@ -99,16 +99,17 @@ export default function Rewards ({ ssrData }) {
let { rewards: [{ total, sources, time, leaderboard }] } = useData(data, ssrData) let { rewards: [{ total, sources, time, leaderboard }] } = useData(data, ssrData)
if (rewardsData?.rewards?.length > 0) { 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 sources = rewardsData.rewards[0].sources
time = rewardsData.rewards[0].time time = rewardsData.rewards[0].time
} }
function EstimatedReward ({ rank }) { function EstimatedReward ({ rank }) {
const totalRest = total - 1000000
return ( return (
<div className='text-muted fst-italic'> <div className='text-muted fst-italic'>
<small> <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> </small>
</div> </div>
) )