This commit is contained in:
parent
73b039dca8
commit
c79c5fa4f2
@ -5,9 +5,9 @@ import Link from "next/link";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
/**
|
/**
|
||||||
* The claimed player.
|
* The player who set the score.
|
||||||
*/
|
*/
|
||||||
player: ScoreSaberPlayer;
|
player?: ScoreSaberPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The score to display.
|
* The score to display.
|
||||||
@ -17,6 +17,7 @@ type Props = {
|
|||||||
|
|
||||||
export default function LeaderboardPlayer({ player, score }: Props) {
|
export default function LeaderboardPlayer({ player, score }: Props) {
|
||||||
const scorePlayer = score.leaderboardPlayerInfo;
|
const scorePlayer = score.leaderboardPlayerInfo;
|
||||||
|
const isPlayerWhoSetScore = player && scorePlayer.id === player.id;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
@ -34,7 +35,7 @@ export default function LeaderboardPlayer({ player, score }: Props) {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
className="h-fit hover:brightness-75 transition-all transform-gpu"
|
className="h-fit hover:brightness-75 transition-all transform-gpu"
|
||||||
>
|
>
|
||||||
<p className={`${scorePlayer.id === player.id && "text-pp"}`}>{scorePlayer.name}</p>
|
<p className={`${isPlayerWhoSetScore && "text-pp"}`}>{scorePlayer.name}</p>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -9,9 +9,9 @@ import ScoreSaberPlayer from "@/common/model/player/impl/scoresaber-player";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
/**
|
/**
|
||||||
* The claimed player.
|
* The player who set the score.
|
||||||
*/
|
*/
|
||||||
player: ScoreSaberPlayer;
|
player?: ScoreSaberPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The score to display.
|
* The score to display.
|
||||||
|
@ -14,8 +14,19 @@ import { scoreAnimation } from "@/components/score/score-animation";
|
|||||||
import ScoreSaberPlayer from "@/common/model/player/impl/scoresaber-player";
|
import ScoreSaberPlayer from "@/common/model/player/impl/scoresaber-player";
|
||||||
|
|
||||||
type LeaderboardScoresProps = {
|
type LeaderboardScoresProps = {
|
||||||
|
/**
|
||||||
|
* The page to show when opening the leaderboard.
|
||||||
|
*/
|
||||||
initialPage?: number;
|
initialPage?: number;
|
||||||
player: ScoreSaberPlayer;
|
|
||||||
|
/**
|
||||||
|
* The player who set the score.
|
||||||
|
*/
|
||||||
|
player?: ScoreSaberPlayer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The leaderboard to display.
|
||||||
|
*/
|
||||||
leaderboard: ScoreSaberLeaderboardToken;
|
leaderboard: ScoreSaberLeaderboardToken;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user