fix team avatars
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
|||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { Tournament } from "@/features/tournaments/types";
|
import { Tournament } from "@/features/tournaments/types";
|
||||||
import { CrownIcon, TreeStructureIcon, InfoIcon, ListDashes } from "@phosphor-icons/react";
|
import { CrownIcon, TreeStructureIcon, InfoIcon, ListDashes } from "@phosphor-icons/react";
|
||||||
import Avatar from "@/components/avatar";
|
import TeamAvatar from "@/components/team-avatar";
|
||||||
import ListLink from "@/components/list-link";
|
import ListLink from "@/components/list-link";
|
||||||
import { Podium } from "./podium";
|
import { Podium } from "./podium";
|
||||||
|
|
||||||
@@ -72,6 +72,8 @@ export const TournamentStats = memo(({ tournament }: TournamentStatsProps) => {
|
|||||||
<Text px="md" size="lg" fw={600}>Results</Text>
|
<Text px="md" size="lg" fw={600}>Results</Text>
|
||||||
<Text px="md" c="dimmed" size="xs" fw={500}>Sorted by win percentage</Text>
|
<Text px="md" c="dimmed" size="xs" fw={500}>Sorted by win percentage</Text>
|
||||||
{teamStatsWithCalculations.map((stat, index) => {
|
{teamStatsWithCalculations.map((stat, index) => {
|
||||||
|
const team = tournament.teams?.find(t => t.id === stat.team_id);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box key={stat.id}>
|
<Box key={stat.id}>
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
@@ -81,7 +83,11 @@ export const TournamentStats = memo(({ tournament }: TournamentStatsProps) => {
|
|||||||
>
|
>
|
||||||
<Group justify="space-between" align="center" w="100%">
|
<Group justify="space-between" align="center" w="100%">
|
||||||
<Group gap="sm" align="center">
|
<Group gap="sm" align="center">
|
||||||
<Avatar name={stat.team_name} size={40} radius="sm" />
|
{team ? (
|
||||||
|
<TeamAvatar team={team} size={40} radius="sm" isRegional={tournament.regional} />
|
||||||
|
) : (
|
||||||
|
<TeamAvatar team={{ id: stat.team_id, name: stat.team_name, players: [] } as any} size={40} radius="sm" isRegional={tournament.regional} />
|
||||||
|
)}
|
||||||
<Stack gap={2}>
|
<Stack gap={2}>
|
||||||
<Group gap='xs'>
|
<Group gap='xs'>
|
||||||
<Text size="xs" c="dimmed">
|
<Text size="xs" c="dimmed">
|
||||||
|
|||||||
Reference in New Issue
Block a user