<commit_before>import React from 'react';
import { Button, FormControl } from 'react-bootstrap';

import Card from '../../components/Card';


export default class LoginCard extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
  static propTypes = {
    error: React.PropTypes.string,
    login: React.PropTypes.func.isRequired,
  }

  static defaultProps = {
    error: '',
  }

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

  handelInputChange(field) {
    return (e) => {
      const newState = {
        ...this.state,
        [field]: e.target.value,
      };
      this.setState(newState);
    };
  }

  handleSubmitClicked = () => {
    this.props.login(this.state.email, this.state.password);
  }

  handelSubmit = (e) => {
    console.log('form submited');
    e.preventDefault();
    // this.handleSubmitClicked();
  }

  render() {
    return (
      <Card className="LoginCard">
        <h1 className="LoginCard-title">Login</h1>
        <form onSubmit={this.handelSubmit}>
          <FormControl
            className="LoginCard-input"
            name="email"
            type="text"
            placeholder="Email address"
            value={this.state.email}
            onChange={this.handelInputChange('email')}
          />
          <FormControl
            className="LoginCard-input"
            name="password"
            type="password"
            placeholder="Password"
            value={this.state.password}
            onChange={this.handelInputChange('password')}
          />
        </form>
        {this.props.error ? <h4 className="LoginCard-servError">{this.props.error}</h4> : ''}
        <Button className="LoginCard-input" onClick={this.handleSubmitClicked}>Submit</Button>
      </Card>
    );
  }
}<commit_msg>Refactored submit button and styles<commit_after>import React from 'react';
import { FormControl } from 'react-bootstrap';
import styled from 'styled-components';

import Button from 'components/Button';
import CenterCard from 'components/CenterCard';
import Title from 'components/Title';

const MarginFormControl = styled(FormControl)`
  margin-bottom: 15px;
`;

const ServerError = styled.p`
  color: red;
  font-size: 1.5rem;
  font-weight: bold;
`;

export default class LoginCard extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
  static propTypes = {
    error: React.PropTypes.string,
    login: React.PropTypes.func.isRequired,
  }

  static defaultProps = {
    error: '',
  }

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

  handelInputChange(field) {
    return (e) => {
      const newState = {
        ...this.state,
        [field]: e.target.value,
      };
      this.setState(newState);
    };
  }

  handelSubmit = (e) => {
    console.log('form submited');
    e.preventDefault();
    // this.props.login(this.state.email, this.state.password);
  }

  render() {
    return (
      <CenterCard className="LoginCard">
        <Title className="LoginCard-title">Login</Title>
        <form onSubmit={this.handelSubmit}>
          <MarginFormControl
            className="LoginCard-input"
            name="email"
            type="text"
            placeholder="Email address"
            value={this.state.email}
            onChange={this.handelInputChange('email')}
          />
          <FormControl
            className="LoginCard-input"
            name="password"
            type="password"
            placeholder="Password"
            value={this.state.password}
            onChange={this.handelInputChange('password')}
          />
          {this.props.error ? <ServerError>{this.props.error}</ServerError> : ''}
          <Button type="submit">Submit</Button>
        </form>
      </CenterCard>
    );
  }
}
{'fraction_non_alphanumeric': 0.13902892013796764, 'fraction_numerical': 0.0021225789334040858, 'mean_word_length': 2.3630686886708294, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2993543', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1092, 'n_words': 189}