Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export const RegisterTeamsDialogContent: React.FC<RegisterTeamsDialogContentProp
}
>
<ListItemText primary={`#${team.number}`} secondary={team.name} />
<Flag region={team.region} size={16} />
<Box sx={{ ml: 1, display: 'flex', alignItems: 'center' }}>
<Flag region={team.region} size={16} />
</Box>
</ListItem>
))}
{availableTeams.length === 0 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import type { Team } from '../graphql/types';
export interface RadarChartDataPoint {
field: string;
score: number;
[key: string]: string | number;
}

export interface CategoryDataPoint {
category: string;
score: number;
[key: string]: string | number;
}

export const calculateAverage = (values: number[]) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,44 @@ interface CategoryRadarChartProps {
category: string;
}

const RadarChartContainer = ({
data,
dataKey,
color = '#64B5F6'
}: {
data: any[];
interface CustomTickProps {
payload?: { value: string };
x?: number;
y?: number;
cx?: number;
cy?: number;
}

const CustomTick = ({ payload, x = 0, y = 0, cx = 0, cy = 0 }: CustomTickProps) => {
const maxLength = 20;
const text = payload?.value || '';
const truncated = text.length > maxLength ? text.substring(0, maxLength) + '...' : text;

return (
<text
x={x}
y={y}
textAnchor={x > cx ? 'start' : x < cx ? 'end' : 'middle'}
dominantBaseline={y > cy ? 'hanging' : y < cy ? 'auto' : 'middle'}
fontSize={11}
fill="currentColor"
>
{truncated}
</text>
);
};

interface RadarChartContainerProps {
data: Array<{ [key: string]: string | number }>;
dataKey: string;
color?: string;
}) => (
}

const RadarChartContainer = ({ data, dataKey, color = '#64B5F6' }: RadarChartContainerProps) => (
<ResponsiveContainer width="100%" height={250}>
<RadarChart data={data} margin={{ top: 5, right: 10, bottom: 5, left: 10 }}>
<RadarChart data={data} margin={{ top: 20, right: 30, bottom: 20, left: 30 }}>
<PolarGrid />
<PolarAngleAxis dataKey={dataKey} tick={{ fontSize: 14 }} />
<PolarAngleAxis dataKey={dataKey} tick={<CustomTick />} />
<PolarRadiusAxis angle={90} domain={[0, 4]} tick={{ fontSize: 12 }} />
<Radar dataKey="score" stroke={color} fill={color} fillOpacity={0.6} />
</RadarChart>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ export function TeamInfo({ team }: TeamInfoProps) {
}, [team.rubrics]);

return (
<Box sx={{ flexShrink: 0, textAlign: 'left', order: 1 }}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<Typography variant="h6" fontWeight={600}>
<Box sx={{ flexShrink: 0, textAlign: 'left', order: 1, minWidth: 0, maxWidth: '100%' }}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, minWidth: 0 }}>
<Typography
variant="h6"
fontWeight={600}
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
minWidth: 0
}}
>
{team.name} - #{team.number}
</Typography>
{team.profileDocumentUrl && (
Expand All @@ -49,11 +58,27 @@ export function TeamInfo({ team }: TeamInfoProps) {
</Tooltip>
)}
</Box>
<Typography variant="h6" color="text.secondary">
<Typography
variant="h6"
color="text.secondary"
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}}
>
{team.affiliation}
</Typography>
{team.judgingSession?.room && (
<Typography variant="h6" color="text.secondary">
<Typography
variant="h6"
color="text.secondary"
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}}
>
{t('judging-room')}: {team.judgingSession.room.name}
</Typography>
)}
Expand Down