aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Modal.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/components/Modal.js')
-rw-r--r--vnext/src/components/Modal.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/vnext/src/components/Modal.js b/vnext/src/components/Modal.js
new file mode 100644
index 00000000..296f7911
--- /dev/null
+++ b/vnext/src/components/Modal.js
@@ -0,0 +1,45 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+import Icon from './Icon';
+
+class Modal extends React.Component {
+ render() {
+ // Render nothing if the "show" prop is false
+ if (!this.props.show) {
+ return null;
+ }
+
+ // 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 (
+ <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>
+ );
+ }
+}
+
+Modal.propTypes = {
+ onClose: PropTypes.func.isRequired,
+ show: PropTypes.bool,
+ children: PropTypes.node
+};
+
+export default Modal; \ No newline at end of file