This repository was archived by the owner on Jul 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathloginPage.js
More file actions
55 lines (43 loc) · 1.43 KB
/
loginPage.js
File metadata and controls
55 lines (43 loc) · 1.43 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
import React from "react";
import { Link } from "react-router-dom";
import registerPage from "./registerPage";
class LoginPage extends React.Component {
constructor(props) {
super(props);
this.state = {
email: "",
password: ""
};
this.handleEmailChange = this.handleEmailChange.bind(this);
this.handlePasswordChange = this.handlePasswordChange.bind(this);
this.handleLogin = this.handleLogin.bind(this);
}
handleEmailChange(event) {
this.setState({ email: event.target.value });
console.log(event.target.value);
}
handlePasswordChange(event) {
this.setState({ password: event.target.value });
console.log(event.target.value);
}
handleLogin(event) {
let data = {
email: this.state.email,
password: this.state.password
};
console.log(data);
// this.props.onLogin(data);
}
render() {
return (
<div>
<form className="homePageForm">
Email<input type="email" onChange={this.handleEmailChange} /><br />
Password<input type="password" onChange={this.handlePasswordChange} /><br />
<input type="button" onClick={this.handleLogin} value="Login" />
</form>
</div>
);
}
}
export default LoginPage;