May 2019
Intermediate to advanced
316 pages
7h 13m
English
Let's first change all the buttons to use the Material-UI Button component. Import Button to the AddCar.js file:
// AddCar.jsimport Button from '@material-ui/core/Button';
Change the buttons to use the Button component. In the list page, we are using the outlined button and in the modal form, we use buttons without any borders. The following code shows the AddCar component:
return ( <div> <Button variant="outlined" color="primary" style={{margin: 10}} onClick={handleClickOpen}> New Car </Button> <Dialog open={open} onClose={handleClose}> <DialogTitle>New car</DialogTitle> <DialogContent> <input type="text" placeholder="Brand" name="brand" value={car.brand} onChange={handleChange}/><br/> <input type="text" placeholder="Model" ...Read now
Unlock full access