Improve page appearance

This commit is contained in:
Pierre HUBERT 2021-07-12 18:55:28 +02:00
parent e7ab1f1837
commit 322969daa7

View File

@ -102,6 +102,30 @@ export class ComunicUserRoute extends React.Component<
} }
build() { build() {
const properties = this.userProperties.map((p) => {
return (
<TableRow key={p.name} hover>
<TableCell
style={{
fontWeight: "bold",
}}
>
{p.name}
</TableCell>
<TableCell>
{p.child != null
? p.child
: p.bool != null
? p.bool
? "Yes"
: "No"
: p.value == null
? "Undefined"
: p.value}
</TableCell>
</TableRow>
);
});
return ( return (
<> <>
<PageTitle <PageTitle
@ -109,36 +133,29 @@ export class ComunicUserRoute extends React.Component<
/> />
<Grid container spacing={3}> <Grid container spacing={3}>
<Grid item xs={6}> <Grid item xs={12}>
<CustomCard title="General information"> <CustomCard title="General information">
<Table> <Grid container>
<TableBody> <Grid item xs={6}>
{this.userProperties.map((p) => { <Table>
return ( <TableBody>
<TableRow key={p.name}> {properties.slice(
<TableCell 0,
style={{ properties.length / 2
fontWeight: "bold", )}
}} </TableBody>
> </Table>
{p.name} </Grid>
</TableCell> <Grid item xs={6}>
<TableCell> <Table>
{p.child != null <TableBody>
? p.child {properties.slice(
: p.bool != null properties.length / 2
? p.bool )}
? "Yes" </TableBody>
: "No" </Table>
: p.value == null </Grid>
? "Undefined" </Grid>
: p.value}
</TableCell>
</TableRow>
);
})}
</TableBody>
</Table>
</CustomCard> </CustomCard>
</Grid> </Grid>
</Grid> </Grid>