-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDialog.jsx
More file actions
43 lines (43 loc) · 954 Bytes
/
Dialog.jsx
File metadata and controls
43 lines (43 loc) · 954 Bytes
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
import React from 'react';
const wrapperStyle = {
position: 'fixed',
top: 0,
right: 0,
bottom: 0,
left: 0,
zIndex: 2000,
height: '100%',
backgroundColor: 'rgba(0,0,0,.5)',
overflow: 'auto',
};
const boxStyle = {
width: '30%',
margin: '0 auto 50px',
marginTop: '15vh',
padding: '20px',
backgroundColor: '#fff',
};
export default class Dialog extends React.Component {
constructor(props) {
super(props);
}
render() {
if (this.props.visible) {
return (
<div style={wrapperStyle}>
<div style={boxStyle}>
<div>
<p>What is your name ?</p>
<input style={{ fontSize: '18px', lineHeight: 2 }} type="text" />
</div>
<button style={{ marginTop: '10px' }} onClick={() => this.props.switchVisible(false)}>
close It!
</button>
</div>
</div>
);
} else {
return null;
}
}
}