content: import React from 'react'
  import {Form, FormGroup, Col, Row, FormControl, ControlLabel, Checkbox, Button, HelpBlock} from 'react-bootstrap'
  import { LinkContainer } from 'react-router-bootstrap'
  import { Field, reduxForm } from 'redux-form'
  import { browserHistory } from 'react-router'
  
  import {FormInput, FormCheckbox} from '../../common/component/render-fields'
  
  import Validate from './register-validation'
  import AsyncValidate from './register-async-validation'
  
  const TacCheckbox = ({input, label, type, meta: {touched, error}}) => (
      <FormGroup validationState={error ? "error" : null}>
          <Checkbox {...input} placeholder={label}>Accept <a href="#">Terms and Conditions</a></Checkbox>
          {touched && error && <HelpBlock>{error}</HelpBlock>}
      </FormGroup>
  )
  
  const Register = React.createClass({
      componentWillMount() {
          this.props.resetMe()
      },
  
      componentWillReceiveProps(nextProps) {
          if(nextProps.user.status === 'authenticated' && nextProps.user.user && !nextProps.user.error) {
              browserHistory.push('/')
          }
      },
  
      render: function() {
          debugger
          return (
              <Row>
                  <Col mdOffset={4} md={4}>
                      <Form horizontal onSubmit={this.props.handleSubmit(this.props.registerUser)} method="post">
                          <Field name="firstName" type="text" component={FormInput} label="First name" />
                          <Field name="lastName" type="text" component={FormInput} label="Last name" />
                          <Field name="email" type="text" component={FormInput} label="Email" />
                          <Field name="password" type="password" component={FormInput} label="Password" />
                          <Field name="repeatPassword" type="password" component={FormInput} label="Repeat password" />
                          <Field name="acceptTAC" label="Accept Terms&Conditions" component={TacCheckbox} />
                          <FormGroup>
                              <Col smOffset={2} sm={10}>
                                  <Button type="submit">
                                      Sign up
                                  </Button>
                              </Col>
                          </FormGroup>
                      </Form>
                  </Col>
              </Row>
          )
      }
  })
  
  export default reduxForm({
      form: 'register-form',
      validate: Validate,
      asyncValidate: AsyncValidate
  })(Register)