aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Modal.js
blob: 799a6f35705ed170a2c913f86c07b4031d962aa8 (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
import React from 'react';
import PropTypes from 'prop-types';

import Icon from './Icon';

import './Modal.css';

function Modal(props) {
    return props.show ? (
        <div id="dialogt">
            <div id="dialogw">
                <div id="dialog_header">
                    <div id="dialogc" onClick={props.onClose}>
                        <Icon name="ei-close" size="s" />
                    </div>
                </div>
                {props.children}
            </div>
        </div>
    ) : (null);
}

export default React.memo(Modal);

Modal.propTypes = {
    onClose: PropTypes.func.isRequired,
    show: PropTypes.bool,
    children: PropTypes.node
};