mui stuff

This commit is contained in:
Olivier Gagnon
2021-09-25 03:09:27 -04:00
parent 4254cc2807
commit cba40c71b2
9 changed files with 167 additions and 178 deletions

View File

@@ -20,37 +20,34 @@ export function ProgramsRoot(): React.ReactElement {
return (
<>
<div>
<Box>
<Typography>
This page displays any programs that you are able to create. Writing the code for a program takes time,
which can vary based on how complex the program is. If you are working on creating a program you can cancel
at any time. Your progress will be saved and you can continue later.
</Typography>
</Box>
<Typography variant="h4">Create program</Typography>
<Typography>
This page displays any programs that you are able to create. Writing the code for a program takes time, which
can vary based on how complex the program is. If you are working on creating a program you can cancel at any
time. Your progress will be saved and you can continue later.
</Typography>
{getAvailableCreatePrograms(player).map((program) => {
const create = program.create;
if (create === null) return <></>;
{getAvailableCreatePrograms(player).map((program) => {
const create = program.create;
if (create === null) return <></>;
return (
<React.Fragment key={program.name}>
<Tooltip title={create.tooltip}>
<Button
sx={{ my: 1 }}
onClick={(event) => {
if (!event.isTrusted) return;
player.startCreateProgramWork(router, program.name, create.time, create.level);
}}
>
{program.name}
</Button>
</Tooltip>
<br />
</React.Fragment>
);
})}
</div>
return (
<React.Fragment key={program.name}>
<Tooltip title={create.tooltip}>
<Button
sx={{ my: 1 }}
onClick={(event) => {
if (!event.isTrusted) return;
player.startCreateProgramWork(router, program.name, create.time, create.level);
}}
>
{program.name}
</Button>
</Tooltip>
<br />
</React.Fragment>
);
})}
</>
);
}