Skip to content

Instantly share code, notes, and snippets.

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