fix
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m22s

This commit is contained in:
Lee 2024-10-23 08:36:55 +01:00
parent 56ae9b717c
commit 6bbf628ab5
3 changed files with 18 additions and 5 deletions

@ -18,6 +18,11 @@ type TablePlayerProps = {
*/ */
highlightedPlayer?: ScoreSaberPlayerToken | ScoreSaberPlayer; highlightedPlayer?: ScoreSaberPlayerToken | ScoreSaberPlayer;
/**
* The additional class names
*/
className?: string;
/** /**
* Hide the country flag * Hide the country flag
*/ */
@ -37,6 +42,7 @@ type TablePlayerProps = {
export function PlayerInfo({ export function PlayerInfo({
player, player,
highlightedPlayer, highlightedPlayer,
className,
hideCountryFlag, hideCountryFlag,
useLink, useLink,
hoverBrightness = true, hoverBrightness = true,
@ -46,7 +52,8 @@ export function PlayerInfo({
className={clsx( className={clsx(
hoverBrightness ? "transform-gpu transition-all hover:brightness-[66%]" : "", hoverBrightness ? "transform-gpu transition-all hover:brightness-[66%]" : "",
player.id == highlightedPlayer?.id ? "font-bold" : "", player.id == highlightedPlayer?.id ? "font-bold" : "",
"text-ellipsis overflow-hidden whitespace-nowrap" `text-ellipsis max-w-[250px] overflow-hidden whitespace-nowrap break-all`,
className
)} )}
style={{ style={{
color: getScoreSaberRole(player)?.color, color: getScoreSaberRole(player)?.color,
@ -57,7 +64,7 @@ export function PlayerInfo({
); );
return ( return (
<div className="flex gap-2 items-center w-[175px]"> <div className="flex gap-2 items-center">
<Avatar className="w-[24px] h-[24px] pointer-events-none"> <Avatar className="w-[24px] h-[24px] pointer-events-none">
<AvatarImage <AvatarImage
alt="Profile Picture" alt="Profile Picture"

@ -92,7 +92,13 @@ export default function Mini({ type, player, shouldUpdate }: MiniProps) {
> >
<p className="text-gray-400">#{formatNumberWithCommas(rank)}</p> <p className="text-gray-400">#{formatNumberWithCommas(rank)}</p>
<div className="flex gap-2 items-center"> <div className="flex gap-2 items-center">
<PlayerInfo player={playerRanking} highlightedPlayer={player} hideCountryFlag hoverBrightness={false} /> <PlayerInfo
className="w-[145px]"
player={playerRanking}
highlightedPlayer={player}
hideCountryFlag
hoverBrightness={false}
/>
</div> </div>
<div className="inline-flex min-w-[13em] gap-2 items-center"> <div className="inline-flex min-w-[13em] gap-2 items-center">
<p className="text-ssr text-right">{formatPp(playerRanking.pp)}pp</p> <p className="text-ssr text-right">{formatPp(playerRanking.pp)}pp</p>

@ -21,11 +21,11 @@ export function PlayerRanking({ player, isCountry }: PlayerRankingProps) {
return ( return (
<> <>
<td className="px-4 py-2"> <td className="px-3 py-2">
#{formatNumberWithCommas(isCountry ? player.countryRank : player.rank)}{" "} #{formatNumberWithCommas(isCountry ? player.countryRank : player.rank)}{" "}
<span className="text-sm">{isCountry && "(#" + formatNumberWithCommas(player.rank) + ")"}</span> <span className="text-sm">{isCountry && "(#" + formatNumberWithCommas(player.rank) + ")"}</span>
</td> </td>
<td className="flex items-center gap-2 px-4 py-2"> <td className="flex items-center gap-2 pl-3 py-2">
<PlayerInfo player={player} highlightedPlayer={claimedPlayer} useLink /> <PlayerInfo player={player} highlightedPlayer={claimedPlayer} useLink />
</td> </td>
<td className="px-4 py-2 text-ssr text-center">{formatPp(player.pp)}pp</td> <td className="px-4 py-2 text-ssr text-center">{formatPp(player.pp)}pp</td>