-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathLoginContainer.js
More file actions
61 lines (50 loc) · 1.65 KB
/
LoginContainer.js
File metadata and controls
61 lines (50 loc) · 1.65 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React, { Component } from 'react';
import Login from './Login';
const displayModal = {
display: 'block',
backgroundColor : '#FFF'
};
const hideModal = {
display: 'none'
};
const themeBackground = {
backgroundColor : '#6e60cc'
};
class LoginContainer extends Component {
constructor(props){
super(props);
this.state = {
isOpenLoginModal : false
};
}
toggleModal = () => {
this.setState({
isOpenLoginModal: !this.state.isOpenLoginModal
});
}
render() {
return (
<React.Fragment>
<button onClick={this.toggleModal} className="btn btn-login ml-2 whiteColor">Login</button>
<div style={this.state.isOpenLoginModal ? displayModal : hideModal } className="modal">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header" style={themeBackground}>
<h4 className="modal-title">Login</h4>
<button onClick={this.toggleModal} type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div className="modal-body" style={themeBackground}>
<Login
closeModal = {this.toggleModal}
user={this.props.user}
loginUser={this.props.loginUser}
/>
</div>
</div>
</div>
</div>
</React.Fragment>
)
}
}
export default LoginContainer