diff --git a/src/backends/github/AuthenticationPage.js b/src/backends/github/AuthenticationPage.js index c85dde2f..d744c8ea 100644 --- a/src/backends/github/AuthenticationPage.js +++ b/src/backends/github/AuthenticationPage.js @@ -6,13 +6,9 @@ export default class AuthenticationPage extends React.Component { onLogin: React.PropTypes.func.isRequired }; - constructor(props) { - super(props); - this.state = {}; - this.handleLogin = this.handleLogin.bind(this); - } + state = {}; - handleLogin(e) { + handleLogin = e => { e.preventDefault(); let auth; if (document.location.host.split(':')[0] === 'localhost') { @@ -28,7 +24,7 @@ export default class AuthenticationPage extends React.Component { } this.props.onLogin(data); }); - } + }; render() { const { loginError } = this.state; diff --git a/src/backends/netlify-git/AuthenticationPage.js b/src/backends/netlify-git/AuthenticationPage.js index 74e508c5..28333d33 100644 --- a/src/backends/netlify-git/AuthenticationPage.js +++ b/src/backends/netlify-git/AuthenticationPage.js @@ -5,13 +5,9 @@ export default class AuthenticationPage extends React.Component { onLogin: React.PropTypes.func.isRequired }; - constructor(props) { - super(props); - this.state = {}; - this.handleLogin = this.handleLogin.bind(this); - } + state = {}; - handleLogin(e) { + handleLogin = e => { e.preventDefault(); const { email, password } = this.state; this.setState({ authenticating: true }); @@ -33,7 +29,7 @@ export default class AuthenticationPage extends React.Component { this.setState({ loginError: data.msg }); }); }); - } + }; handleChange(key) { return (e) => { diff --git a/src/backends/test-repo/AuthenticationPage.js b/src/backends/test-repo/AuthenticationPage.js index ce20b0bf..a6f2e130 100644 --- a/src/backends/test-repo/AuthenticationPage.js +++ b/src/backends/test-repo/AuthenticationPage.js @@ -5,21 +5,16 @@ export default class AuthenticationPage extends React.Component { onLogin: React.PropTypes.func.isRequired }; - constructor(props) { - super(props); - this.state = { email: '' }; - this.handleLogin = this.handleLogin.bind(this); - this.handleEmailChange = this.handleEmailChange.bind(this); - } + state = { email: '' }; - handleLogin(e) { + handleLogin = e => { e.preventDefault(); this.props.onLogin(this.state); - } + }; - handleEmailChange(e) { + handleEmailChange = e => { this.setState({ email: e.target.value }); - } + }; render() { return