all repos — caroster @ 5cebc5ee581a8c1bb7674e3b338c56de1cb5d847

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

frontend/containers/WelcomeDialog/index.js (view raw)

 1import React from 'react';
 2import {makeStyles} from '@material-ui/core/styles';
 3import Dialog from '@material-ui/core/Dialog';
 4import CardMedia from '@material-ui/core/CardMedia';
 5import DialogActions from '@material-ui/core/DialogActions';
 6import DialogContent from '@material-ui/core/DialogContent';
 7import DialogContentText from '@material-ui/core/DialogContentText';
 8import Button from '@material-ui/core/Button';
 9import {useTranslation} from 'react-i18next';
10import useTourStore from '../../stores/useTourStore';
11
12const WelcomeDialog = () => {
13  const {t} = useTranslation();
14  const showWelcome = useTourStore(s => s.showWelcome);
15  const setTour = useTourStore(s => s.setTour);
16  const classes = useStyles();
17
18  return (
19    <Dialog open={showWelcome}>
20      <CardMedia
21        className={classes.media}
22        image="/assets/Caroster_Octree_Social.jpg"
23      />
24      <DialogContent>
25        <DialogContentText>{t('tour.welcome.text')}</DialogContentText>
26      </DialogContent>
27      <DialogActions>
28        <Button onClick={() => setTour({showWelcome: false})} id="TourCancel">
29          {t('tour.welcome.nope')}
30        </Button>
31        <Button
32          onClick={() =>
33            setTour({showWelcome: false, run: false, step: 0, prev: -1})
34          }
35          id="TourConfirm"
36        >
37          {t('tour.welcome.onboard')}
38        </Button>
39      </DialogActions>
40    </Dialog>
41  );
42};
43
44const useStyles = makeStyles({
45  media: {
46    height: 240,
47  },
48});
49
50export default WelcomeDialog;