aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/layout/AppLayout.js2
-rw-r--r--src/components/ui/Modal/index.js59
-rw-r--r--src/components/ui/Modal/styles.js32
3 files changed, 93 insertions, 0 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js
index dbe0bb4b6..28eaa7fdc 100644
--- a/src/components/layout/AppLayout.js
+++ b/src/components/layout/AppLayout.js
@@ -6,6 +6,7 @@ import { TitleBar } from 'electron-react-titlebar';
6 6
7import InfoBar from '../ui/InfoBar'; 7import InfoBar from '../ui/InfoBar';
8import { Component as DelayApp } from '../../features/delayApp'; 8import { Component as DelayApp } from '../../features/delayApp';
9import { Component as BasicAuth } from '../../features/basicAuth';
9import ErrorBoundary from '../util/ErrorBoundary'; 10import ErrorBoundary from '../util/ErrorBoundary';
10 11
11import globalMessages from '../../i18n/globalMessages'; 12import globalMessages from '../../i18n/globalMessages';
@@ -161,6 +162,7 @@ export default @observer class AppLayout extends Component {
161 </InfoBar> 162 </InfoBar>
162 )} 163 )}
163 {isDelayAppScreenVisible && (<DelayApp />)} 164 {isDelayAppScreenVisible && (<DelayApp />)}
165 <BasicAuth />
164 {services} 166 {services}
165 </div> 167 </div>
166 </div> 168 </div>
diff --git a/src/components/ui/Modal/index.js b/src/components/ui/Modal/index.js
new file mode 100644
index 000000000..d84e4c713
--- /dev/null
+++ b/src/components/ui/Modal/index.js
@@ -0,0 +1,59 @@
1import React, { Component } from 'react';
2import ReactModal from 'react-modal';
3import PropTypes from 'prop-types';
4import classnames from 'classnames';
5import injectCSS from 'react-jss';
6
7import styles from './styles';
8
9export default @injectCSS(styles) class Modal extends Component {
10 static propTypes = {
11 children: PropTypes.node.isRequired,
12 className: PropTypes.string,
13 classes: PropTypes.object.isRequired,
14 isOpen: PropTypes.bool.isRequired,
15 portal: PropTypes.string,
16 close: PropTypes.func.isRequired,
17 }
18
19 static defaultProps = {
20 className: null,
21 portal: 'modal-portal',
22 }
23
24 render() {
25 const {
26 children,
27 className,
28 classes,
29 isOpen,
30 portal,
31 close,
32 } = this.props;
33
34 return (
35 <ReactModal
36 isOpen={isOpen}
37 className={classnames({
38 [`${classes.modal}`]: true,
39 [`${className}`]: className,
40 })}
41 portalClassName={classes.component}
42 overlayClassName={classes.overlay}
43 portal={portal}
44 onRequestClose={close}
45 >
46 {/* <button
47 type="button"
48 className={classnames({
49 [`${classes.close}`]: true,
50 'mdi mdi-close': true,
51 })}
52 /> */}
53 <div className={classes.content}>
54 {children}
55 </div>
56 </ReactModal>
57 );
58 }
59}
diff --git a/src/components/ui/Modal/styles.js b/src/components/ui/Modal/styles.js
new file mode 100644
index 000000000..56fecbf55
--- /dev/null
+++ b/src/components/ui/Modal/styles.js
@@ -0,0 +1,32 @@
1export default theme => ({
2 component: {
3 zIndex: 500,
4 position: 'absolute',
5 },
6 overlay: {
7 background: theme.colorModalOverlayBackground,
8 position: 'fixed',
9 top: 0,
10 left: 0,
11 right: 0,
12 bottom: 0,
13 display: 'flex',
14 },
15 modal: {
16 background: '#FFF',
17 maxWidth: '90%',
18 height: 'auto',
19 margin: 'auto auto',
20 borderRadius: 6,
21 boxShadow: '0px 13px 40px 0px rgba(0,0,0,0.2)',
22 position: 'relative',
23 },
24 content: {
25 padding: 20,
26 },
27 close: {
28 position: 'absolute',
29 top: 0,
30 right: 0,
31 },
32});