content: import React from 'react';
  import PropTypes from 'prop-types';
  import axios from 'axios';
  
  class RegisterForm extends React.Component {
    state = { submitBtnEnabled: true };
  
    handleSubmit = (e) => {
      e.preventDefault();
      this.setState({ submitBtnEnabled: false });
  
      console.log(this.props.registration_url);
      axios.post(this.props.registration_url, {
        'user[email]': e.target.elements.user_email,
        'user[password]': e.target.elements.user_password
      }).then((response) => {
        console.log('res', response);
        this.setState({ submitBtnEnabled: true });
      }).catch((error) => {
        console.log('error', error);
        this.setState({ submitBtnEnabled: true });
      });
    };
  
    render () {
      return (
        <section className="imageblock switchable feature-large height-100 bg--primary">
          <div className="imageblock__content col-lg-6 col-md-4 pos-right">
            <div className="background-image-holder">
              <img alt="image" src="/theme/img/inner-7.jpg"/>
            </div>
          </div>
          <div className="container pos-vertical-center">
            <div className="row">
              <div className="col-lg-5 col-md-7">
                <h2>
                  Create a Sinum account
                </h2>
                <p className="lead">
                  Get started a free — cancel at any time.
                </p>
                <div className="row">
                  <form className="new_user" acceptCharset="UTF-8" onSubmit={this.handleSubmit}>
                    <div className="col-12 type--fine-print">
                      <input className="form-control" placeholder="Email Address" type="email" name="user_email" />
                    </div>
                    <div className="col-12 type--fine-print">
                      <br/>
                      <input autoComplete="off" className="form-control" placeholder="Password" type="password" name="user_password" />
                    </div>
                    <div className="col-12">
                      <button className="btn btn--primary type--uppercase" type="submit" disabled={!this.state.submitBtnEnabled}>Create Account</button>
                    </div>
                    <div className="col-12">
                      <span className="type--fine-print">By signing up, you agree to the <a href="#">Terms of Service</a></span>
                    </div>
                  </form>
                </div>
              </div>
            </div>
          </div>
        </section>
      );
    }
  }
  
  RegisterForm.propTypes = {
    name: PropTypes.string
  };
  
  export default RegisterForm;
  