From 0d1eb9b12e44631b4fb644554988c90f00e9fb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:12:34 -0600 Subject: [PATCH] feat: better reward handling --- src/app/tools/ratings/page.tsx | 65 ++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/src/app/tools/ratings/page.tsx b/src/app/tools/ratings/page.tsx index be0232178..36617dd15 100644 --- a/src/app/tools/ratings/page.tsx +++ b/src/app/tools/ratings/page.tsx @@ -906,7 +906,9 @@ export default function Page() { Position Player - Reward + {season === 0 && ( + Reward + )} Percentile @@ -946,46 +948,55 @@ export default function Page() { : 'unset', cursor: 'pointer', }} - key={index} + key={`${region}${season}${index}`} onClick={() => { setHighlightedPlayer({ type: 'position', position: index }); }} > - {position.toLocaleString()}. - + {position.toLocaleString()}. + {names[region][id] === null ? `Deleted player ${id}` : names[region][id]?.nickname ?? `Loading player...`} {clan ? ` [${clan}]` : ''} - - {reward ? ( - - - {reward.count === 1 ? '' : `x${reward.count}`} - - ) : ( - '--' - )} - - + {season === 0 && ( + + {reward ? ( + + { + + {reward.count === 1 ? '' : `x ${reward.count}`} + + + ) : ( + '--' + )} + + )} + {totalPlayers ? Math.ceil(((index + 1) / totalPlayers) * 100) : '--'} % - + {players[region][season]?.[index]?.score.toLocaleString()}