-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42cca43
commit 5aa6400
Showing
8 changed files
with
191 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { ScorekeeperApp } from './scorekeeper-app'; | ||
|
||
export { ScorekeeperApp }; |
60 changes: 60 additions & 0 deletions
60
front-end/src/apps/scorekeeper/match-control/alliance-card.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Grid, Paper, Typography } from '@mui/material'; | ||
import { Alliance, BLUE_STATION, MatchParticipant } from '@toa-lib/models'; | ||
import { FC } from 'react'; | ||
|
||
interface Props { | ||
alliance: Alliance; | ||
participants?: MatchParticipant[]; | ||
} | ||
|
||
export const AllianceCard: FC<Props> = ({ alliance, participants }) => { | ||
const allianceParticipants = participants | ||
? participants.filter((p) => | ||
alliance === 'red' | ||
? p.station < BLUE_STATION | ||
: p.station >= BLUE_STATION | ||
) | ||
: []; | ||
return ( | ||
<Paper | ||
className={alliance === 'red' ? 'red-bg-imp' : 'blue-bg-imp'} | ||
sx={{ paddingBottom: (theme) => theme.spacing(1) }} | ||
> | ||
<Grid container spacing={3}> | ||
<Grid item md={4} sx={{ paddingTop: '4px !important' }}> | ||
<Typography variant='body1' align='center'> | ||
Team | ||
</Typography> | ||
</Grid> | ||
<Grid item md={4} sx={{ paddingTop: '4px !important' }}> | ||
<Typography variant='body1' align='center'> | ||
Card Status | ||
</Typography> | ||
</Grid> | ||
<Grid item md={2} sx={{ paddingTop: '4px !important' }}> | ||
<Typography variant='body1' align='center'> | ||
No Show | ||
</Typography> | ||
</Grid> | ||
<Grid item md={2} sx={{ paddingTop: '4px !important' }}> | ||
<Typography variant='body1' align='center'> | ||
DQ | ||
</Typography> | ||
</Grid> | ||
</Grid> | ||
{allianceParticipants.map((p) => ( | ||
<Grid key={`${p.teamKey}-${p.station}`} container spacing={3}> | ||
<Grid item md={8}> | ||
{/* <TeamStatusRow key={p.teamKey} station={p.station} /> */} | ||
</Grid> | ||
<Grid item md={2}> | ||
{/* <NoShowStatus key={`no-show-${p.teamKey}`} station={p.station} /> */} | ||
</Grid> | ||
<Grid item md={2}> | ||
{/* <DisqualifiedStatus key={`dq-${p.teamKey}`} station={p.station} /> */} | ||
</Grid> | ||
</Grid> | ||
))} | ||
</Paper> | ||
); | ||
}; |
28 changes: 28 additions & 0 deletions
28
front-end/src/apps/scorekeeper/match-control/match-control-header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Grid } from '@mui/material'; | ||
import { FC } from 'react'; | ||
import { PrestartButton } from './prestart-button'; | ||
|
||
export const MatchControlHeader: FC = () => { | ||
return ( | ||
<Grid container spacing={3}> | ||
<Grid item xs={12} sm={6} md={4} lg={2}> | ||
<PrestartButton /> | ||
</Grid> | ||
<Grid item xs={12} sm={6} md={4} lg={2}> | ||
AudienceDisplayButton | ||
</Grid> | ||
<Grid item xs={12} sm={6} md={4} lg={2}> | ||
FieldPrepButton | ||
</Grid> | ||
<Grid item xs={12} sm={6} md={4} lg={2}> | ||
StartMatchButton | ||
</Grid> | ||
<Grid item xs={12} sm={6} md={4} lg={2}> | ||
CommitScoresButton | ||
</Grid> | ||
<Grid item xs={12} sm={6} md={4} lg={2}> | ||
PostResultsButton | ||
</Grid> | ||
</Grid> | ||
); | ||
}; |
35 changes: 35 additions & 0 deletions
35
front-end/src/apps/scorekeeper/match-control/match-status.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Box, Chip, Divider, Paper, Typography } from '@mui/material'; | ||
import { FC } from 'react'; | ||
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; | ||
|
||
export const MatchStatus: FC = () => { | ||
return ( | ||
<Paper sx={{ height: '100%' }}> | ||
<Box | ||
sx={{ | ||
padding: (theme) => theme.spacing(2), | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center' | ||
}} | ||
> | ||
<Typography align='center'>Match Status</Typography> | ||
<Chip | ||
icon={<CheckCircleOutlineIcon />} | ||
label='Match Started' | ||
color='primary' | ||
variant='outlined' | ||
/> | ||
</Box> | ||
<Divider /> | ||
<Box sx={{ padding: (theme) => theme.spacing(2) }}> | ||
<Typography gutterBottom align='center' variant='body1'> | ||
Match Status | ||
</Typography> | ||
<Typography align='center' variant='h4'> | ||
Match Countdown | ||
</Typography> | ||
</Box> | ||
</Paper> | ||
); | ||
}; |
22 changes: 22 additions & 0 deletions
22
front-end/src/apps/scorekeeper/match-control/prestart-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Button } from '@mui/material'; | ||
import { FC, useState } from 'react'; | ||
|
||
export const PrestartButton: FC = () => { | ||
const [canPrestart, setCanPrestart] = useState(true); | ||
const prestart = () => setCanPrestart(false); | ||
const cancelPrestart = () => setCanPrestart(true); | ||
return canPrestart ? ( | ||
<Button fullWidth color='warning' variant='contained' onClick={prestart}> | ||
Prestart | ||
</Button> | ||
) : ( | ||
<Button | ||
fullWidth | ||
color='error' | ||
variant='contained' | ||
onClick={cancelPrestart} | ||
> | ||
Cancel Prestart | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { FC } from 'react'; | ||
import { useCurrentEvent } from 'src/api/use-event-data'; | ||
import DefaultLayout from 'src/layouts/DefaultLayout'; | ||
import { MatchControlHeader } from './match-control/match-control-header'; | ||
import { Grid } from '@mui/material'; | ||
import { AllianceCard } from './match-control/alliance-card'; | ||
|
||
export const ScorekeeperApp: FC = () => { | ||
const { data: event } = useCurrentEvent(); | ||
return ( | ||
<DefaultLayout | ||
containerWidth='xl' | ||
title={`${event?.eventName} | Scorekeeper App`} | ||
titleLink={`/${event?.eventKey}`} | ||
> | ||
<Grid | ||
container | ||
spacing={3} | ||
sx={{ marginTop: (theme) => theme.spacing(2) }} | ||
> | ||
<Grid item xs={12} sm={6} md={6}> | ||
<AllianceCard alliance='red' /> | ||
</Grid> | ||
<Grid item xs={12} sm={6} md={6}> | ||
<AllianceCard alliance='blue' /> | ||
</Grid> | ||
</Grid> | ||
<MatchControlHeader /> | ||
</DefaultLayout> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters