Skip to content
Snippets Groups Projects
Commit 4fd8aced authored by James D'Alton's avatar James D'Alton
Browse files

Initial layout: Prettified

parent 6bdd0b5e
No related branches found
No related tags found
No related merge requests found
import React from 'react'; import React from 'react';
import { Grid } from '@material-ui/core'; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Paper, makeStyles } from '@material-ui/core';
const useStyles = makeStyles({
table: {
minWidth: 650,
},
});
const FormsDisplay = ({ formItems }) => { const FormsDisplay = ({ formItems }) => {
const classes = useStyles();
return ( return (
<div> <div>
{formItems.map( <TableContainer component={Paper}>
(formItem, i) => <Table className={classes.table} aria-label="simple table">
<Grid <TableHead>
container <TableRow>
direction="column" <TableCell>Form name</TableCell>
justify="space-evenly" <TableCell align="right">Owner</TableCell>
alignItems="stretch" <TableCell align="right">Date modified</TableCell>
spacing={3} </TableRow>
item </TableHead>
xs={9} <TableBody>
key={i}> {formItems.map(formItem => (
<FormItem <TableRow key={formItem.name}>
name={formItem.name} <TableCell component="th" scope="row">
owner={formItem.owner} {formItem.name}
dateModified={formItem.dateModified} /> </TableCell>
</Grid> <TableCell align="right">{formItem.owner}</TableCell>
)} <TableCell align="right">{formItem.dateModified}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</div> </div>
) )
} }
const FormItem = ({ name, owner, dateModified }) => {
return (
<Grid
container
direction="row"
spacing={3}>
<Grid item xs={3}>
<h3>{name}</h3>
</Grid>
<Grid item xs={3}>
<h3>{owner}</h3>
</Grid>
<Grid item xs={3}>
<div outline="2px solid black">
<h3>{dateModified}</h3>
</div>
</Grid>
</Grid>
)
}
export default FormsDisplay export default FormsDisplay
\ No newline at end of file
...@@ -34,6 +34,8 @@ const Page = () => { ...@@ -34,6 +34,8 @@ const Page = () => {
const classes = useStyles(); const classes = useStyles();
return ( return (
<Grid container spacing={3}> <Grid container spacing={3}>
{/* Header */}
<Grid item xs={12}> <Grid item xs={12}>
<AppBar position="static"> <AppBar position="static">
<Toolbar> <Toolbar>
...@@ -44,22 +46,17 @@ const Page = () => { ...@@ -44,22 +46,17 @@ const Page = () => {
</Toolbar> </Toolbar>
</AppBar> </AppBar>
</Grid> </Grid>
<Grid
item {/* Side Menu */}
xs={3} <Grid item xs={2}>
>
<Menu menuItems={menuItems} /> <Menu menuItems={menuItems} />
</Grid> </Grid>
<Grid
container {/* Form Area */}
item <Grid item xs={10}>
xs={9}
direction="column"
justify="space-evenly"
spacing={3}
>
<FormsDisplay formItems={formItems} /> <FormsDisplay formItems={formItems} />
</Grid> </Grid>
</Grid> </Grid>
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment