From 87d49822027c3c2cc336a187129e34d8a046498a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 30 May 2023 22:02:51 +0300 Subject: [PATCH] Tournament: Sort teams alphabetically on admin page --- app/features/tournament/routes/to.$id.admin.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/features/tournament/routes/to.$id.admin.tsx b/app/features/tournament/routes/to.$id.admin.tsx index 360a91354..69cc2be62 100644 --- a/app/features/tournament/routes/to.$id.admin.tsx +++ b/app/features/tournament/routes/to.$id.admin.tsx @@ -294,11 +294,14 @@ function AdminActions() { value={selectedTeamId} onChange={(e) => setSelectedTeamId(Number(e.target.value))} > - {data.teams.map((team) => ( - - ))} + {data.teams + .slice() + .sort((a, b) => a.name.localeCompare(b.name)) + .map((team) => ( + + ))} {selectedTeam && selectedAction.inputs.includes("ROSTER_MEMBER") ? (