fix team avatars
This commit is contained in:
@@ -106,6 +106,7 @@ function RouteComponent() {
|
||||
showControls
|
||||
tournamentId={tournament.id}
|
||||
hasKnockoutBracket={knockoutBracketPopulated}
|
||||
isRegional={tournament.regional}
|
||||
/>
|
||||
<Divider />
|
||||
<div>
|
||||
@@ -120,6 +121,7 @@ function RouteComponent() {
|
||||
showControls
|
||||
tournamentId={tournament.id}
|
||||
hasKnockoutBracket={knockoutBracketPopulated}
|
||||
isRegional={tournament.regional}
|
||||
/>
|
||||
) : (
|
||||
<BracketView bracket={bracket} showControls groupConfig={tournament.group_config} />
|
||||
|
||||
@@ -39,6 +39,7 @@ function RouteComponent() {
|
||||
<GroupStageView
|
||||
groups={tournament.groups || []}
|
||||
matches={tournament.matches || []}
|
||||
isRegional={tournament.regional}
|
||||
/>
|
||||
</Container>
|
||||
);
|
||||
|
||||
@@ -49,9 +49,10 @@ interface TeamListProps {
|
||||
teams: TeamInfo[];
|
||||
loading?: boolean;
|
||||
onTeamClick?: (teamId: string) => void;
|
||||
isRegional?: boolean;
|
||||
}
|
||||
|
||||
const TeamList = ({ teams, loading = false, onTeamClick }: TeamListProps) => {
|
||||
const TeamList = ({ teams, loading = false, onTeamClick, isRegional }: TeamListProps) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleClick = useCallback(
|
||||
@@ -92,6 +93,7 @@ const TeamList = ({ teams, loading = false, onTeamClick }: TeamListProps) => {
|
||||
team={team}
|
||||
radius="sm"
|
||||
size={40}
|
||||
isRegional={isRegional}
|
||||
/>
|
||||
}
|
||||
style={{ cursor: "pointer" }}
|
||||
|
||||
@@ -16,6 +16,7 @@ interface GroupStageViewProps {
|
||||
showControls?: boolean;
|
||||
tournamentId?: string;
|
||||
hasKnockoutBracket?: boolean;
|
||||
isRegional?: boolean;
|
||||
}
|
||||
|
||||
interface TeamStanding {
|
||||
@@ -35,6 +36,7 @@ const GroupStageView: React.FC<GroupStageViewProps> = ({
|
||||
showControls,
|
||||
tournamentId,
|
||||
hasKnockoutBracket,
|
||||
isRegional,
|
||||
}) => {
|
||||
const queryClient = useQueryClient();
|
||||
const [expandedTeams, setExpandedTeams] = useState<Record<string, boolean>>({});
|
||||
@@ -334,7 +336,7 @@ const GroupStageView: React.FC<GroupStageViewProps> = ({
|
||||
<Text size="sm" fw={700} c="dimmed" w={24} ta="center">
|
||||
{index + 1}
|
||||
</Text>
|
||||
<TeamAvatar team={standing.team} size={28} radius="sm" isRegional={matches[0]?.tournament?.regional} />
|
||||
<TeamAvatar team={standing.team} size={28} radius="sm" isRegional={isRegional} />
|
||||
<Text size="sm" fw={500} style={{ flex: 1 }} lineClamp={1}>
|
||||
{standing.teamName}
|
||||
</Text>
|
||||
|
||||
@@ -27,7 +27,7 @@ const Profile = ({ id }: ProfileProps) => {
|
||||
{
|
||||
label: "Teams",
|
||||
content: <>
|
||||
<TeamList teams={tournament.teams || []} />
|
||||
<TeamList teams={tournament.teams || []} isRegional={tournament.regional} />
|
||||
</>
|
||||
}
|
||||
], [tournament]);
|
||||
|
||||
@@ -99,7 +99,7 @@ const StartedTournament: React.FC<{ tournament: Tournament }> = ({
|
||||
to={`/tournaments/${tournament.id}/bracket`}
|
||||
Icon={TreeStructureIcon}
|
||||
/>
|
||||
<TeamListButton teams={tournament.teams || []} />
|
||||
<TeamListButton teams={tournament.teams || []} isRegional={tournament.regional} />
|
||||
<RulesListButton tournamentId={tournament.id} />
|
||||
</Box>
|
||||
</Stack>
|
||||
|
||||
@@ -151,12 +151,12 @@ const UpcomingTournament: React.FC<{ tournament: Tournament }> = ({
|
||||
/>
|
||||
{tournament.regional === true ? (
|
||||
(tournament.teams && tournament.teams.length > 0) ? (
|
||||
<TeamListButton teams={tournament.teams} />
|
||||
<TeamListButton teams={tournament.teams} isRegional={true} />
|
||||
) : (
|
||||
<EnrolledPlayersListButton tournamentId={tournament.id} />
|
||||
)
|
||||
) : (
|
||||
<TeamListButton teams={tournament.teams || []} />
|
||||
<TeamListButton teams={tournament.teams || []} isRegional={false} />
|
||||
)}
|
||||
<RulesListButton tournamentId={tournament.id} />
|
||||
</Box>
|
||||
|
||||
@@ -8,9 +8,10 @@ import { useMemo } from "react"
|
||||
|
||||
interface TeamListButtonProps {
|
||||
teams: TeamInfo[]
|
||||
isRegional?: boolean
|
||||
}
|
||||
|
||||
const TeamListButton: React.FC<TeamListButtonProps> = ({ teams }) => {
|
||||
const TeamListButton: React.FC<TeamListButtonProps> = ({ teams, isRegional }) => {
|
||||
const count = useMemo(() => teams.length, [teams]);
|
||||
const { open, isOpen, toggle } = useSheet();
|
||||
return (
|
||||
@@ -22,7 +23,7 @@ const TeamListButton: React.FC<TeamListButtonProps> = ({ teams }) => {
|
||||
/>
|
||||
|
||||
<Sheet title="Enrolled Teams" opened={isOpen} onChange={toggle}>
|
||||
<TeamList teams={teams} />
|
||||
<TeamList teams={teams} isRegional={isRegional} />
|
||||
</Sheet>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user