cleanup
Some checks failed
Deploy Website / deploy (push) Has been cancelled

This commit is contained in:
Lee 2024-10-11 20:16:38 +01:00
parent 9f6a58e325
commit 306269f1f9

@ -92,15 +92,17 @@ const playerData = [
const statisticChange = player.statisticChange; const statisticChange = player.statisticChange;
const rankChange = statisticChange?.today?.rank ?? 0; const rankChange = statisticChange?.today?.rank ?? 0;
return renderChange( return (
<div className="text-gray-300 flex gap-1 items-center">
{renderChange(
player, player,
"rank", "rank",
<Link href={`/ranking/${player.rankPages.global}`}> <Link href={`/ranking/${player.rankPages.global}`}>
<div className="text-gray-300 flex gap-1 items-center">
<p className="hover:brightness-75 transition-all transform-gpu">#{formatNumberWithCommas(player.rank)}</p> <p className="hover:brightness-75 transition-all transform-gpu">#{formatNumberWithCommas(player.rank)}</p>
</Link>
)}
{rankChange != 0 && renderDailyChange(rankChange, <p>The change in your rank compared to yesterday</p>)} {rankChange != 0 && renderDailyChange(rankChange, <p>The change in your rank compared to yesterday</p>)}
</div> </div>
</Link>
); );
}, },
}, },
@ -113,18 +115,20 @@ const playerData = [
const statisticChange = player.statisticChange; const statisticChange = player.statisticChange;
const rankChange = statisticChange?.today?.countryRank ?? 0; const rankChange = statisticChange?.today?.countryRank ?? 0;
return renderChange( return (
<div className="text-gray-300 flex gap-1 items-center">
{renderChange(
player, player,
"countryRank", "countryRank",
<Link href={`/ranking/${player.country}/${player.rankPages.country}`}> <Link href={`/ranking/${player.country}/${player.rankPages.global}`}>
<div className="text-gray-300 flex gap-1 items-center">
<p className="hover:brightness-75 transition-all transform-gpu"> <p className="hover:brightness-75 transition-all transform-gpu">
#{formatNumberWithCommas(player.countryRank)} #{formatNumberWithCommas(player.countryRank)}
</p> </p>
</Link>
)}
{rankChange != 0 && {rankChange != 0 &&
renderDailyChange(rankChange, <p>The change in your country rank compared to yesterday</p>)} renderDailyChange(rankChange, <p>The change in your country rank compared to yesterday</p>)}
</div> </div>
</Link>
); );
}, },
}, },
@ -134,15 +138,14 @@ const playerData = [
const statisticChange = player.statisticChange; const statisticChange = player.statisticChange;
const ppChange = statisticChange?.today?.pp ?? 0; const ppChange = statisticChange?.today?.pp ?? 0;
return renderChange( return (
<div className="text-gray-300 flex gap-1 items-center">
{renderChange(
player, player,
"pp", "pp",
<div className="text-pp flex gap-1 items-center"> <p className="hover:brightness-75 transition-all transform-gpu text-pp">{formatPp(player.pp)}pp</p>
<p>{formatPp(player.pp)}pp</p> )}
{ppChange != 0 && {ppChange != 0 && renderDailyChange(ppChange, <p>The change in your pp compared to yesterday</p>)}
renderDailyChange(ppChange, <p>The change in your pp compared to yesterday</p>, number => {
return `${formatPp(number)}pp`;
})}
</div> </div>
); );
}, },