frontend/containers/CarColumns/AddCar.tsx (view raw)
1import React from 'react';
2import Button from '@material-ui/core/Button';
3import Container from '@material-ui/core/Container';
4import {makeStyles} from '@material-ui/core';
5import {useTranslation} from 'react-i18next';
6
7interface Props {
8 toggleNewCar: () => void;
9}
10
11const AddCar = (props: Props) => {
12 const {toggleNewCar} = props;
13 const classes = useStyles();
14 const {t} = useTranslation();
15 return (
16 <Container maxWidth="sm" className={classes.container}>
17 <Button
18 className="tour_car_add1"
19 classes={{containedSecondary: classes.button}}
20 fullWidth
21 variant="contained"
22 color="secondary"
23 onClick={toggleNewCar}
24 >
25 {t('car.creation.title')}
26 </Button>
27 </Container>
28 );
29};
30
31const useStyles = makeStyles(theme => ({
32 container: {
33 display: 'flex',
34 justifyContent: 'center',
35 padding: 0,
36 },
37 button: {
38 backgroundColor: theme.palette.background.paper,
39 color: theme.palette.text.primary,
40 '&:hover': {color: theme.palette.secondary.contrastText},
41 },
42}));
43
44export default AddCar;