{"size": 1297, "ext": "js", "max_stars_repo_path": "artfolio2.0/src/components/auth/SignIn.js", "max_stars_repo_name": "angel-torres/at-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "artfolio2.0/src/components/auth/SignIn.js", "max_issues_repo_name": "angel-torres/at-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "artfolio2.0/src/components/auth/SignIn.js", "max_forks_repo_name": "angel-torres/at-frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.8222222222, "max_line_length": 131, "alphanum_fraction": 0.5797995374}
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { signIn } from '../../actions'

class SignIn extends Component {

  state = {
    username: '',
    password: '',
  }

  signIn = e => {
    e.preventDefault();
    this.props.history.push(`/`)
    this.props.signIn(this.state);
  }

  handleChanges = e => {
    this.setState({
      [e.target.name]: e.target.value
    })
  }

  render() {
    return (
      <form onSubmit={this.signIn} className="container card" style={{margin:"40px auto", padding:"60px"}}>
        <div className="row">
              <div className="input-field col s12">
              <input onChange={this.handleChanges} value={this.state.username} name="username" type="text" className="validate"/>
              <label>Username</label>
              </div>
          </div>
          <div className="row">
            <div className="input-field col s12">
            <input onChange={this.handleChanges} value={this.state.password} name="password" type="password" className="validate"/>
            <label>Password</label>
            </div>
        </div>
          <button className="waves-effect waves-light btn #00695c teal darken-3">Sign In</button>
      </form>
    )
  }
}

export default connect(null, { signIn })(SignIn)