Skip to content

Commit

Permalink
Fix bracket display for seeds over 99 Closes #2041
Browse files Browse the repository at this point in the history
  • Loading branch information
Sendouc committed Jan 23, 2025
1 parent 54d30a3 commit 1321597
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/features/tournament-bracket/components/Bracket/Match.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ function MatchRow({
const logoSrc =
!simulated && team ? tournament.tournamentTeamLogoSrc(team) : null;

const isBigSeedNumber = team?.seed && team.seed > 99;

return (
<div
className={clsx("stack horizontal", { "text-lighter": isLoser })}
Expand All @@ -181,6 +183,7 @@ function MatchRow({
<div
className={clsx("bracket__match__seed", {
"text-lighter-important italic opaque": simulated,
bracket__match__seed__wide: isBigSeedNumber,
})}
>
{team?.seed}
Expand All @@ -191,7 +194,11 @@ function MatchRow({
"text-theme-secondary":
!simulated && ownTeam && ownTeam?.id === team?.id,
"text-lighter italic opaque": simulated,
"bracket__match__team-name__narrow": logoSrc,
"bracket__match__team-name__narrow":
// either but not both
(logoSrc || isBigSeedNumber) && !(logoSrc && isBigSeedNumber),
// both
"bracket__match__team-name__narrowest": logoSrc && isBigSeedNumber,
invisible: !team,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ a.bracket__match:hover {
max-width: 15px;
}

.bracket__match__seed__wide {
min-width: 20px;
max-width: 20px;
}

.bracket__match__team-name {
max-width: 95px;
overflow: hidden;
Expand All @@ -94,6 +99,10 @@ a.bracket__match:hover {
max-width: 75px;
}

.bracket__match__team-name__narrowest {
max-width: 70px;
}

.bracket__match__score {
margin-inline-start: auto;
}
Expand Down

0 comments on commit 1321597

Please sign in to comment.