Skip to content
Snippets Groups Projects
Verified Commit 4d5834ad authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Pass parameters to component and Grid tags.

parent 72a11a4b
No related branches found
No related tags found
2 merge requests!56Refined auth flow and new website pages.,!54Setup reservation for api compatibility.
This commit is part of merge request !54. Comments created here will be created in the context of that merge request.
import React, { FC } from 'react'; import React, { FC } from 'react';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { import {
Grid,
Paper, Paper,
Table, Table,
TableBody, TableBody,
...@@ -18,43 +19,45 @@ const useStyles = makeStyles(() => ({ ...@@ -18,43 +19,45 @@ const useStyles = makeStyles(() => ({
}, },
})); }));
function createData( type ReservationProps = {
name: string, departure: string;
value: string, destination: string;
): { name: string; value: string } { time: string;
return { name, value }; date: string;
} };
const rows = [
createData('From:', 'Via Di Quel Bozen, 45, 39037'),
createData('Date:', '29 / 07 / 2021'),
createData('Time:', '12:15'),
createData('To:', 'Via del Krankenhaus, 7, 39037'),
];
export const Reservation: FC = () => { export const Reservation: FC<ReservationProps> = ({
departure,
destination,
time,
date,
}: ReservationProps) => {
const classes = useStyles(); const classes = useStyles();
return ( return (
<TableContainer component={Paper}> <Grid item container style={{ paddingTop: '20px' }}>
<Table aria-label="simple table"> <Grid item xs={1} lg={2} />
<TableHead> <Grid item xs={10} lg={8}>
<TableRow> <TableContainer component={Paper}>
<TableCell>DriveToHospital </TableCell> <Table aria-label="simple table">
</TableRow> <TableHead>
</TableHead> <TableRow>
<TableCell>DriveToHospital </TableCell>
</TableRow>
</TableHead>
<TableBody> <TableBody>
{rows.map((row) => ( <TableRow key="departure">
<TableRow key={row.name}> <TableCell component="th" scope="row">
<TableCell component="th" scope="row"> Departure
{row.name} </TableCell>
</TableCell> <TableCell align="right">{departure}</TableCell>
<TableCell align="right">{row.value}</TableCell> </TableRow>
</TableRow> </TableBody>
))} </Table>
</TableBody> </TableContainer>
</Table> </Grid>
</TableContainer> <Grid item xs={1} lg={2} />
</Grid>
); );
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment