make diff buttons look nicer
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m7s
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m7s
This commit is contained in:
parent
e0aeec5d5a
commit
caf5f01a09
@ -10,7 +10,7 @@ import LeaderboardScore from "./leaderboard-score";
|
|||||||
import { scoreAnimation } from "@/components/score/score-animation";
|
import { scoreAnimation } from "@/components/score/score-animation";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { clsx } from "clsx";
|
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 { fetchLeaderboardScores } from "@ssr/common/utils/score-utils";
|
||||||
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
|
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
|
||||||
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
|
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
|
||||||
@ -169,13 +169,19 @@ export default function LeaderboardScores({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isSelected = leaderboardId === selectedLeaderboardId;
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
key={difficultyRaw}
|
key={difficultyRaw}
|
||||||
variant={leaderboardId === selectedLeaderboardId ? "default" : "outline"}
|
variant={isSelected ? "default" : "outline"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleLeaderboardChange(leaderboardId);
|
handleLeaderboardChange(leaderboardId);
|
||||||
}}
|
}}
|
||||||
|
className={`border ${isSelected ? "bg-primary/5 font-bold" : ""}`}
|
||||||
|
style={{
|
||||||
|
color: getDifficultyFromRawDifficulty(difficultyRaw).color,
|
||||||
|
borderColor: getDifficultyFromRawDifficulty(difficultyRaw).color,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{difficulty.name}
|
{difficulty.name}
|
||||||
</Button>
|
</Button>
|
||||||
|
Reference in New Issue
Block a user