Skip to content

Instantly share code, notes, and snippets.

@bnhansn
Created October 21, 2016 13:34
Show Gist options
  • Save bnhansn/ce9e4452a95df04203a06e59b993ed99 to your computer and use it in GitHub Desktop.
Save bnhansn/ce9e4452a95df04203a06e59b993ed99 to your computer and use it in GitHub Desktop.
// @flow
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { login } from '../../actions/session';
import LoginForm from '../../components/LoginForm';
import Navbar from '../../components/Navbar';
type Props = {
login: () => void,
}
class Login extends Component {
static contextTypes = {
router: PropTypes.object,
}
props: Props
handleLogin = data => this.props.login(data, this.context.router);
render() {
return (
<div style={{ flex: '1' }}>
<Navbar />
<LoginForm onSubmit={this.handleLogin} />
</div>
);
}
}
export default connect(null, { login })(Login);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment