all repos — caroster @ 091e697e0d29245b95892a59b8ce86ed6f6b37d1

[Octree] Group carpool to your event https://caroster.io

fix empty dashboard create event Link
Hadrien Froger hadrien@octree.ch
Sat, 18 Jul 2020 08:01:17 +0100
commit

091e697e0d29245b95892a59b8ce86ed6f6b37d1

parent

995af3d29df1253f12cf2da4b6bd8930cee6b046

1 files changed, 11 insertions(+), 2 deletions(-)

jump to
M app/src/containers/Dashboard/EmptyDashboard.jsapp/src/containers/Dashboard/EmptyDashboard.js

@@ -5,9 +5,11 @@ import CardContent from '@material-ui/core/CardContent';

import Typography from '@material-ui/core/Typography'; import Button from '@material-ui/core/Button'; import {useTranslation} from 'react-i18next'; - +import {useHistory} from 'react-router-dom'; export const EmptyDashboard = () => { const {t} = useTranslation(); + const history = useHistory(); + const goNewEvent = history.push.bind(undefined, '/new'); return ( <Card> <CardContent>

@@ -16,13 +18,20 @@ {t('dashboard.noEvent.title')}

</Typography> <Typography variant="body1" + gutterBottom dangerouslySetInnerHTML={{ __html: t('dashboard.noEvent.text_html'), }} /> </CardContent> <CardActions> - <Button>{t('dashboard.noEvent.create_event')}</Button> + <Button + onClick={() => goNewEvent()} + variant="contained" + color="primary" + > + {t('dashboard.noEvent.create_event')} + </Button> </CardActions> </Card> );