-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPharmDModal.js
More file actions
54 lines (46 loc) · 1.24 KB
/
PharmDModal.js
File metadata and controls
54 lines (46 loc) · 1.24 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
import React from 'react';
import Modal from '@material-ui/core/Modal';
import { styled } from "twin.macro";
import PropTypes from "prop-types";
const ModalFrame = styled(Modal)`
margin-top: 10%;
margin-bottom: 10%;
margin-left: 15%;
margin-right: 15%;
`
const InnerModal = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
color: ${props => props.theme.palette.primary.main};
background-color: white;
padding: 20px;
`
const PharmDModal = props => {
return (
<ModalFrame open={props.open}
onBackdropClick={props.onClose}
aria-labelledby={props.title}
aria-describedby="PharmD Modal View"
>
<InnerModal>
{typeof props.title === "string" ?
<h2>{props.title}</h2>
: props.title
}
{props.children}
</InnerModal>
</ModalFrame>
)
}
PharmDModal.propTypes = {
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
open: PropTypes.bool,
onClose: PropTypes.func,
}
PharmDModal.defaultProps = {
title: "",
open: false,
onClose: null
}
export default PharmDModal;