fix: dedup battle-logs list (one row/session), case-insensitive vehicle lookup, win/loss colors, clearer dividers, centered stat columns

This commit is contained in:
FURRO404
2026-06-18 01:29:30 -07:00
parent 616139d6ce
commit 51c0dd264a
4 changed files with 81 additions and 84 deletions
+26 -24
View File
@@ -2870,43 +2870,45 @@ function GamePage({ gameId, navigate }) {
<div className="overflow-x-auto">
<div className="min-w-[720px]">
{participants.length ? (
<div className={`grid ${SCOREBOARD_GRID} gap-3 border-b border-surface px-5 py-3 text-xs font-semibold uppercase tracking-wide text-text-soft`}>
<div className={`grid ${SCOREBOARD_GRID} gap-3 border-b border-border px-5 py-3 text-xs font-semibold uppercase tracking-wide text-text-soft`}>
<p>Team / player</p>
<p className="text-right">Air</p>
<p className="text-right">Ground</p>
<p className="text-right">Assists</p>
<p className="text-right">Deaths</p>
<p className="text-right">Caps</p>
<p className="text-right">Score</p>
<p className="text-center">Air</p>
<p className="text-center">Ground</p>
<p className="text-center">Assists</p>
<p className="text-center">Deaths</p>
<p className="text-center">Caps</p>
<p className="text-center">Score</p>
</div>
) : null}
{participants.map((participant) => {
const won = String(participant.result || '').toLowerCase() === 'win'
const accent = won ? 'border-l-win' : 'border-l-loss'
const nameColor = won ? 'text-win' : 'text-loss'
return (
<div className="border-b border-surface" key={participant.team_name}>
<div className={`border-b-4 border-border border-l-4 ${accent}`} key={participant.team_name}>
<button
className={`grid w-full ${SCOREBOARD_GRID} items-center gap-3 px-5 py-3 text-left transition hover:bg-surface`}
className={`grid w-full ${SCOREBOARD_GRID} items-center gap-3 border-b border-border bg-surface/60 px-5 py-3 text-left transition hover:bg-surface`}
onClick={() => navigate(teamPath(participant.team_name))}
type="button"
>
<div className="min-w-0">
<p className={`truncate font-semibold ${won ? 'text-fury-violet' : 'text-text-soft'}`}>
<p className={`truncate font-bold ${nameColor}`}>
{participant.team_name}
</p>
<p className="text-xs text-text-muted">
<p className={`text-xs font-semibold uppercase tracking-wide ${nameColor}`}>
{won ? 'Win' : 'Loss'} · {formatNumber(participant.player_count)} players
</p>
</div>
<p className="text-right text-sm">{formatNumber(participant.stats?.air_kills)}</p>
<p className="text-right text-sm">{formatNumber(participant.stats?.ground_kills)}</p>
<p className="text-right text-sm">{formatNumber(participant.stats?.assists)}</p>
<p className="text-right text-sm">{formatNumber(participant.stats?.deaths)}</p>
<p className="text-right text-sm">{formatNumber(participant.stats?.captures)}</p>
<p className="text-right text-sm font-semibold">{formatNumber(participant.stats?.score)}</p>
<p className="text-center text-sm">{formatNumber(participant.stats?.air_kills)}</p>
<p className="text-center text-sm">{formatNumber(participant.stats?.ground_kills)}</p>
<p className="text-center text-sm">{formatNumber(participant.stats?.assists)}</p>
<p className="text-center text-sm">{formatNumber(participant.stats?.deaths)}</p>
<p className="text-center text-sm">{formatNumber(participant.stats?.captures)}</p>
<p className="text-center text-sm font-semibold">{formatNumber(participant.stats?.score)}</p>
</button>
<div className="pb-3">
<div className="divide-y divide-surface py-1">
{(participant.players || []).map((player) => (
<button
className={`grid w-full ${SCOREBOARD_GRID} items-center gap-3 px-5 py-2 text-left text-sm transition hover:bg-surface`}
@@ -2938,12 +2940,12 @@ function GamePage({ gameId, navigate }) {
)}
</div>
</div>
<p className="text-right">{formatNumber(player.stats?.air_kills)}</p>
<p className="text-right">{formatNumber(player.stats?.ground_kills)}</p>
<p className="text-right">{formatNumber(player.stats?.assists)}</p>
<p className="text-right">{formatNumber(player.stats?.deaths)}</p>
<p className="text-right">{formatNumber(player.stats?.captures)}</p>
<p className="text-right font-semibold">{formatNumber(player.stats?.score)}</p>
<p className="text-center">{formatNumber(player.stats?.air_kills)}</p>
<p className="text-center">{formatNumber(player.stats?.ground_kills)}</p>
<p className="text-center">{formatNumber(player.stats?.assists)}</p>
<p className="text-center">{formatNumber(player.stats?.deaths)}</p>
<p className="text-center">{formatNumber(player.stats?.captures)}</p>
<p className="text-center font-semibold">{formatNumber(player.stats?.score)}</p>
</button>
))}
</div>
+4
View File
@@ -80,6 +80,8 @@
--color-success: #00f2ff;
--color-warning: #f4ee3e;
--color-danger: #e82517;
--color-win: #1a9e4b;
--color-loss: #e82517;
}
:root[data-theme="dark"] {
@@ -102,6 +104,8 @@
--color-success: #58f0f5;
--color-warning: #f4ee3e;
--color-danger: #ff6a5f;
--color-win: #46d17e;
--color-loss: #ff6a5f;
color-scheme: dark;
}