fix calc message & format day count
This commit is contained in:
parent
d6f4dd8c19
commit
c64f38eec7
@ -53,21 +53,31 @@ export default function Home() {
|
||||
setInterval(updateRank, 1000 * 60 * 1); // update every minute
|
||||
}, [mounted, updateRank]);
|
||||
|
||||
return (
|
||||
<main className="text-xl text-white">
|
||||
{!playerId && <p>Invalid player ID</p>}
|
||||
/**
|
||||
* {!playerId && <p>Invalid player ID</p>}
|
||||
{!rank && <p>Invalid rank</p>}
|
||||
{!ppDiff && <p>Calculating...</p>}
|
||||
{ppDiff && (
|
||||
*/
|
||||
if (!playerId || !rank || !ppDiff) {
|
||||
return (
|
||||
<main className="text-xl text-white">
|
||||
<p>Calculating...</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="text-xl text-white">
|
||||
<div className="flex gap-1 flex-col p-2">
|
||||
<p>
|
||||
{formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)}
|
||||
</p>
|
||||
{startedAt && (
|
||||
<p>Day {getDaysSince(new Date(Number(startedAt))) + 1}</p>
|
||||
<p>
|
||||
Day {formatNumber(getDaysSince(new Date(Number(startedAt))) + 1)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user