Created
October 21, 2016 13:34
-
-
Save bnhansn/ce9e4452a95df04203a06e59b993ed99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @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