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 @@ -52,20 +52,20 @@ export const TeamInfo: React.FC<TeamInfoProps> = ({ team, size, textAlign = 'lef
alignItems: 'center'
}}
>
{team.affiliation && `${team.affiliation}, `}
{team.city}
{team.region && (
<>
<Box
component="span"
sx={{
display: 'inline-flex',
alignItems: 'center'
}}
>
<Flag region={team.region} size={flagSizeMap[size]} />
</Box>
</>
<Box
component="span"
sx={{
display: 'inline-flex',
alignItems: 'center',
ml: 0.5
}}
>
<Flag region={team.region} size={flagSizeMap[size]} />
</Box>
)}
{team.affiliation && ` ${team.affiliation},`} {team.city}
</Typography>
</Stack>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const MatchRow: React.FC<MatchRowProps> = ({ match, tables, teams }) => {
return (
<TableCell key={table.id} align="center">
{team ? (
<Tooltip title={`${team.name} ${team.arrived ? '' : `(${t('not-arrived')})`}`} arrow>
<Tooltip title={team.arrived ? '' : t('not-arrived')} arrow>
<Box
sx={{
display: 'inline-flex',
Expand All @@ -94,7 +94,7 @@ export const MatchRow: React.FC<MatchRowProps> = ({ match, tables, teams }) => {
fontSize: isMobile ? '0.75rem' : '1rem'
}}
>
#{team.number}
#{team.number} {team.name}
</Typography>
</Box>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function NextMatchPanel({ match }: NextMatchPanelProps) {
sx={{ flex: 1, fontSize: '1.05rem', fontWeight: 500 }}
>
{participant.team
? t('next-match.team-number', { number: participant.team.number })
? `${t('next-match.team-number', { number: participant.team.number })} ${participant.team.name}`
: '—'}
</Typography>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import {
TableRow,
Paper,
Typography,
Box,
Tooltip
Box
} from '@mui/material';
import { useMatchTranslations } from '@lems/localization';
import { useTime } from '../../../../../../../../lib/time/hooks';
Expand All @@ -37,7 +36,7 @@ const TeamsCell = ({ participants }: TeamsCellProps) => {
.sort((a, b) => a.table.name.localeCompare(b.table.name, undefined, { numeric: true }))
.map((participant, idx) => {
const { team, table } = participant;
const teamNumber = team?.number ? `#${team.number}` : '—';
const teamDisplay = team ? `#${team.number} ${team.name}` : '—';

return (
<Box key={idx} sx={{ display: 'flex', gap: 0.75, alignItems: 'center' }}>
Expand All @@ -47,19 +46,17 @@ const TeamsCell = ({ participants }: TeamsCellProps) => {
>
{table?.name || 'Unknown'}
</Typography>
<Tooltip title={team ? `${team.name}` : ''} arrow>
<Typography
variant="body2"
sx={{
fontWeight: 500,
minWidth: '2.5rem',
fontFamily: 'monospace',
fontSize: '1.1rem'
}}
>
{teamNumber}
</Typography>
</Tooltip>
<Typography
variant="body2"
sx={{
fontWeight: 500,
minWidth: '2.5rem',
fontFamily: 'monospace',
fontSize: '1.1rem'
}}
>
{teamDisplay}
</Typography>
</Box>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ export function ScheduleTable({ rooms, rows, sessionLength }: ScheduleTableProps
{row.rooms?.map(room => (
<TableCell key={room.id} align="center">
{room.team ? (
<Tooltip
title={`${room.team.name} ${room.team.arrived ? '' : `(${t('not-arrived')})`}`}
arrow
>
<Tooltip title={room.team.arrived ? '' : t('not-arrived')} arrow>
<Box
sx={{
display: 'inline-flex',
Expand All @@ -200,7 +197,7 @@ export function ScheduleTable({ rooms, rows, sessionLength }: ScheduleTableProps
fontSize: isMobile ? '0.75rem' : '1rem'
}}
>
#{room.team.number}
#{room.team.number} {room.team.name}
</Typography>
</Box>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useMemo } from 'react';
import { useTranslations } from 'next-intl';
import dayjs from 'dayjs';
import { Box, Card, CardContent, Paper, Skeleton, Stack, Typography } from '@mui/material';
import { Box, Card, CardContent, Grid, Paper, Skeleton, Stack, Typography } from '@mui/material';
import { useJudgingStatus } from '../judging-status-context';
import { SessionCard } from './session-card';

Expand Down Expand Up @@ -65,18 +65,21 @@ export const JudgingStatusMobile: React.FC = () => {
</Stack>
</Paper>

{sortedRooms.map(room => {
const session = currentSessions.find(s => s.room.id === room.id);
return session ? (
<SessionCard
key={`${room.id}-${session.id}`}
session={session}
room={room}
isCurrentRound={true}
sessionLength={sessionLength}
/>
) : null;
})}
<Grid container spacing={2}>
{sortedRooms.map(room => {
const session = currentSessions.find(s => s.room.id === room.id);
return session ? (
<Grid key={`${room.id}-${session.id}`} size={{ xs: 12, sm: 6, md: 4 }}>
<SessionCard
session={session}
room={room}
isCurrentRound={true}
sessionLength={sessionLength}
/>
</Grid>
) : null;
})}
</Grid>
</Box>
)}

Expand All @@ -93,18 +96,21 @@ export const JudgingStatusMobile: React.FC = () => {
</Stack>
</Paper>

{sortedRooms.map(room => {
const session = nextSessions.find(s => s.room.id === room.id);
return session ? (
<SessionCard
key={`${room.id}-${session.id}`}
session={session}
room={room}
isCurrentRound={false}
sessionLength={sessionLength}
/>
) : null;
})}
<Grid container spacing={2}>
{sortedRooms.map(room => {
const session = nextSessions.find(s => s.room.id === room.id);
return session ? (
<Grid key={`${room.id}-${session.id}`} size={{ xs: 12, sm: 6, md: 4 }}>
<SessionCard
session={session}
room={room}
isCurrentRound={false}
sessionLength={sessionLength}
/>
</Grid>
) : null;
})}
</Grid>
</Box>
)}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ export const NextSessionRow: React.FC<NextSessionRowProps> = ({ session }) => {
const team = session?.team;

return (
<TableCell align="center" sx={{ verticalAlign: 'top', py: 2 }}>
<TableCell align="center" sx={{ py: 2, height: '100%' }}>
{session && team ? (
<Stack spacing={1} alignItems="center">
<Stack
spacing={1}
alignItems="center"
sx={{ height: '100%', minHeight: 150 }}
justifyContent="center"
>
<TeamInfo team={team} size="sm" textAlign="center" />
{!team.arrived && (
<Chip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useTranslations } from 'next-intl';
import dayjs from 'dayjs';
import { Card, CardContent, Stack, Typography } from '@mui/material';
import { Box, Card, CardContent, Stack, Typography } from '@mui/material';
import { JudgingSession, Room } from '../graphql';
import { TeamInfo } from '../../../components/team-info';
import { SessionStatusChip } from './session-status-chip';
Expand All @@ -28,11 +28,14 @@ export const SessionCard: React.FC<SessionCardProps> = ({
key={`${room.id}-${session.id}`}
sx={{
mb: 2,
bgcolor: isCurrentRound ? 'primary.50' : 'background.paper'
bgcolor: isCurrentRound ? 'primary.50' : 'background.paper',
height: '100%',
display: 'flex',
flexDirection: 'column'
}}
>
<CardContent>
<Stack spacing={1.5}>
<CardContent sx={{ display: 'flex', flexDirection: 'column', flex: 1, pb: 2 }}>
<Stack spacing={1.5} sx={{ flex: 1 }}>
<Typography variant="subtitle2" color="text.secondary" sx={{ fontWeight: 600 }}>
{t('table.room', { name: room.name })}
</Typography>
Expand All @@ -41,6 +44,8 @@ export const SessionCard: React.FC<SessionCardProps> = ({
<>
<TeamInfo team={team} size="sm" />

<Box sx={{ flex: 1 }} />

<Stack direction="row" spacing={0.5} alignItems="center" flexWrap="wrap">
<SessionStatusChip
status={session.status}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@ export const SessionRow: React.FC<SessionRowProps> = ({ session, sessionLength }
const team = session.team;

return (
<TableCell align="center" sx={{ verticalAlign: 'top', py: 2 }}>
<TableCell align="center" sx={{ py: 2, height: '100%' }}>
{session && team ? (
<Stack spacing={1} alignItems="center">
<Stack spacing={1} alignItems="center" sx={{ height: '100%', minHeight: 150 }}>
<Box sx={{ minWidth: 180 }}>
<TeamInfo team={team} size="sm" textAlign="center" />
</Box>

<Stack direction="row" spacing={0.5} alignItems="center" flexWrap="wrap">
<Box sx={{ flex: 1 }} />

<Stack
direction="row"
spacing={0.5}
alignItems="center"
flexWrap="wrap"
justifyContent="center"
>
<SessionStatusChip
status={session.status}
called={session.called}
Expand Down