make diff buttons look nicer
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m7s

This commit is contained in:
Lee 2024-10-19 13:13:36 +01:00
parent e0aeec5d5a
commit caf5f01a09

@ -10,7 +10,7 @@ import LeaderboardScore from "./leaderboard-score";
import { scoreAnimation } from "@/components/score/score-animation";
import { Button } from "@/components/ui/button";
import { clsx } from "clsx";
import { getDifficultyFromRawDifficulty } from "@/common/song-utils";
import { getDifficulty, getDifficultyFromRawDifficulty } from "@/common/song-utils";
import { fetchLeaderboardScores } from "@ssr/common/utils/score-utils";
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
@ -169,13 +169,19 @@ export default function LeaderboardScores({
return null;
}
const isSelected = leaderboardId === selectedLeaderboardId;
return (
<Button
key={difficultyRaw}
variant={leaderboardId === selectedLeaderboardId ? "default" : "outline"}
variant={isSelected ? "default" : "outline"}
onClick={() => {
handleLeaderboardChange(leaderboardId);
}}
className={`border ${isSelected ? "bg-primary/5 font-bold" : ""}`}
style={{
color: getDifficultyFromRawDifficulty(difficultyRaw).color,
borderColor: getDifficultyFromRawDifficulty(difficultyRaw).color,
}}
>
{difficulty.name}
</Button>