fix some React errors

This commit is contained in:
Olivier Gagnon 2022-07-21 15:24:03 -04:00
parent 2d522ea1e6
commit 5c551348ed
3 changed files with 33 additions and 32 deletions

@ -232,7 +232,7 @@ export function FactionsRoot(props: IProps): React.ReactElement {
sx={{ sx={{
gap: 1, gap: 1,
gridTemplateColumns: (invitations.length > 0 ? "1fr " : "") + "2fr", gridTemplateColumns: (invitations.length > 0 ? "1fr " : "") + "2fr",
[theme.breakpoints.down("lg")]: { gridTemplateColumns: "1fr", "& > span:nth-child(1)": { order: 1 } }, [theme.breakpoints.down("lg")]: { gridTemplateColumns: "1fr", "& > span:nth-of-type(1)": { order: 1 } },
gridTemplateRows: "minmax(0, 1fr)", gridTemplateRows: "minmax(0, 1fr)",
"& > span > .MuiBox-root": { "& > span > .MuiBox-root": {
display: "grid", display: "grid",

@ -15,7 +15,6 @@ export function process(this: IPlayer, cycles = 1): void {
} }
} }
export function finish(this: IPlayer, cancelled: boolean): void { export function finish(this: IPlayer, cancelled: boolean): void {
console.error("finishing");
if (this.currentWork === null) return; if (this.currentWork === null) return;
this.currentWork.finish(this, cancelled); this.currentWork.finish(this, cancelled);
this.currentWork = null; this.currentWork = null;

@ -87,6 +87,7 @@ export function ProgramsRoot(): React.ReactElement {
sx={{ p: 1, opacity: player.hasProgram(program.name) ? 0.75 : 1 }} sx={{ p: 1, opacity: player.hasProgram(program.name) ? 0.75 : 1 }}
key={program.name} key={program.name}
> >
<>
<Typography variant="h6" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}> <Typography variant="h6" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}>
{(player.hasProgram(program.name) && <Check sx={{ mr: 1 }} />) || {(player.hasProgram(program.name) && <Check sx={{ mr: 1 }} />) ||
(create.req(player) && <Create sx={{ mr: 1 }} />) || <Lock sx={{ mr: 1 }} />} (create.req(player) && <Create sx={{ mr: 1 }} />) || <Lock sx={{ mr: 1 }} />}
@ -118,6 +119,7 @@ export function ProgramsRoot(): React.ReactElement {
</Typography> </Typography>
)} )}
<Typography>{create.tooltip}</Typography> <Typography>{create.tooltip}</Typography>
</>
</Box> </Box>
); );
})} })}