summaryrefslogtreecommitdiff
path: root/client/src/components/CalendarDialog.tsx
blob: cff5512e55e8512b3a29a93ff8cb0ff0ca0eb539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import React from 'react';
import {
  Dialog,
  DialogContent,
  DialogContentText,
  DialogTitle,
  IconButton,
  useTheme,
} from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import { useAppDispatch, useAppSelector } from '../hooks';
import { hideDialog, selectUIState } from '../slices/uiSlice';

function CalendarDialog() {
  const dispatch = useAppDispatch();
  const { dialogOpen } = useAppSelector(selectUIState);
  const theme = useTheme();

  const handleClose = () => {
    dispatch(hideDialog());
  };

  return (
    <Dialog
      open={dialogOpen}
      onClose={handleClose}
      PaperProps={{ sx: { borderRadius: 2 } }}
    >
      <DialogTitle sx={{ textAlign: 'center' }}>
        Calendar Invitation
      </DialogTitle>
      <IconButton
        aria-label="close"
        onClick={handleClose}
        sx={(theme) => ({
          position: 'absolute',
          right: 8,
          top: 8,
          color: theme.palette.grey[500],
        })}
      >
        <CloseIcon />
      </IconButton>
      <DialogContent
        sx={{
          height: '100%',
          width: '100%',
          display: 'flex',
          flexDirection: 'column',
          justifyContent: 'center',
          alignItems: 'center',
          gap: 4,
        }}
      >
        <DialogContentText color="inherit">
          Scan the QR code or click the link below to add the calendar invite to
          your device.
        </DialogContentText>
        <img src="/madison-michael-qr-code.png" />
        <a
          href="/madison-michael-wedding.ics"
          style={{ color: theme.palette.primary.main }}
        >
          Add to calendar
        </a>
      </DialogContent>
    </Dialog>
  );
}

export default CalendarDialog;