Skip to content

Commit

Permalink
fix: sort classes on leaderboards page
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrising committed May 13, 2024
1 parent f8fcb38 commit 362a8df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,20 @@ function ProfileLeaderboard({ game, playtype }: GamePT) {
{Object.keys(r.classes).length === 0 ? (
<Muted>None</Muted>
) : (
Object.entries(r.classes).map(
([k, v]) =>
v && (
<ClassBadge
key={k}
classSet={k as keyof typeof r.classes}
game={game}
playtype={playtype}
classValue={v}
/>
)
)
Object.entries(r.classes)
.sort(StrSOV((x) => x[0]))
.map(
([k, v]) =>
v && (
<ClassBadge
key={k}
classSet={k as keyof typeof r.classes}
game={game}
playtype={playtype}
classValue={v}
/>
)
)
)}
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import LoadingWrapper from "components/util/LoadingWrapper";
import { useProfileRatingAlg } from "components/util/useScoreRatingAlg";
import React, { useState } from "react";
import { useQuery } from "react-query";
import { Link } from "react-router-dom";
import {
COLOUR_SET,
FormatGame,
Expand Down

0 comments on commit 362a8df

Please sign in to comment.