blob: 5ee8c3ec8e32eeb3e0a7d43d927609e6c25bc835 (
plain) (
blame)
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
|
import React from 'react';
import PropTypes from 'prop-types';
import Icon from './Icon';
function Modal(props) {
// The gray background
const backdropStyle = {
position: 'fixed',
top: 0,
bottom: 0,
left: 0,
right: 0,
backgroundColor: 'rgba(0, 0, 0, 0.3)',
padding: 50
};
return props.show ? (
<div id="dialogt" style={backdropStyle}>
<div id="dialogw">
<div id="dialog_header">
<div id="dialogc" onClick={this.props.onClose}>
<Icon name="ei-close" size="s" />
</div>
</div>
{this.props.children}
</div>
</div>
) : (null);
}
export default React.memo(Modal);
Modal.propTypes = {
onClose: PropTypes.func.isRequired,
show: PropTypes.bool,
children: PropTypes.node
};
|