-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContactInfoModal.tsx
More file actions
83 lines (79 loc) · 2.07 KB
/
Copy pathContactInfoModal.tsx
File metadata and controls
83 lines (79 loc) · 2.07 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
import React from 'react';
import {
Dialog,
DialogTitle,
DialogContent,
List,
ListItem,
ListItemIcon,
ListItemText,
IconButton,
Typography,
Box,
Avatar,
} from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import PhoneIcon from '@mui/icons-material/Phone';
import EmailIcon from '@mui/icons-material/Email';
import { RiderType } from '@carriage-web/shared/types/rider';
interface ContactInfoModalProps {
open: boolean;
onClose: () => void;
rider: RiderType | undefined;
}
const ContactInfoModal: React.FC<ContactInfoModalProps> = ({
open,
onClose,
rider,
}) => {
if (!rider) {
return null;
}
return (
<Dialog open={open} onClose={onClose} fullWidth maxWidth="xs">
<DialogTitle sx={{ m: 0, p: 2 }}>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Avatar src={rider.photoLink} sx={{ width: 40, height: 40, mr: 2 }}>
{rider.firstName.charAt(0)}
{rider.lastName.charAt(0)}
</Avatar>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
{rider.firstName} {rider.lastName}
</Typography>
<IconButton
aria-label="close"
onClick={onClose}
sx={{
position: 'absolute',
right: 8,
top: 8,
color: (theme) => theme.palette.grey[500],
}}
>
<CloseIcon />
</IconButton>
</Box>
</DialogTitle>
<DialogContent dividers>
<List>
<ListItem>
<ListItemIcon>
<PhoneIcon />
</ListItemIcon>
<ListItemText
primary="Phone Number"
secondary={rider.phoneNumber || 'Not provided'}
/>
</ListItem>
<ListItem>
<ListItemIcon>
<EmailIcon />
</ListItemIcon>
<ListItemText primary="Email" secondary={rider.email} />
</ListItem>
</List>
</DialogContent>
</Dialog>
);
};
export default ContactInfoModal;