<commit_before>import React from 'react';
import {reduxForm, Field} from 'redux-form';
import {Card, CardTitle, CardText, CardActions, FlatButton} from 'material-ui';
import {Flex} from 'reflexbox';
import TextField from './components/TextField';

const Login = ({handleSubmit}) => (
  <Flex auto column align='center' justify='center'>
    <form onSubmit={handleSubmit}>
      <Card>
        <CardTitle title='Login' />
        <CardText>
          <Flex column>
            <Field name={'email'} component={TextField} label='Email' />
            <Field name={'password'} component={TextField} type={'password'} label='Password' />
          </Flex>
        </CardText>
        <CardActions>
          <FlatButton type='submit' label='Lets go!' primary />
          <FlatButton label='Not a user?' secondary />
        </CardActions>
      </Card>
    </form>
  </Flex>
);

const validate = values => {
  const errors = ['email', 'password'].reduce((acc, field) => {
    return !values[field] ? {...acc, [field]: 'Required'} : acc;
  }, {});

  if (values.email && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(values.email)) {
    errors.email = 'Invalid email address';
  }

  return errors;
};

export default reduxForm({
  form: 'loginForm',<commit_msg>fix(register-button): removed registration button<commit_after>import React from 'react';
import {reduxForm, Field} from 'redux-form';
import {Card, CardTitle, CardText, CardActions, FlatButton} from 'material-ui';
import {Flex} from 'reflexbox';
import TextField from './components/TextField';

const Login = ({handleSubmit}) => (
  <Flex auto column align='center' justify='center'>
    <form onSubmit={handleSubmit}>
      <Card>
        <CardTitle title='Login' />
        <CardText>
          <Flex column>
            <Field name={'email'} component={TextField} label='Email' />
            <Field name={'password'} component={TextField} type={'password'} label='Password' />
          </Flex>
        </CardText>
        <CardActions>
          <FlatButton type='submit' label='Lets go!' primary />
        </CardActions>
      </Card>
    </form>
  </Flex>
);

const validate = values => {
  const errors = ['email', 'password'].reduce((acc, field) => {
    return !values[field] ? {...acc, [field]: 'Required'} : acc;
  }, {});

  if (values.email && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(values.email)) {
    errors.email = 'Invalid email address';
  }

  return errors;
};

export default reduxForm({
  form: 'loginForm',
{'fraction_non_alphanumeric': 0.187873952931791, 'fraction_numerical': 0.004786597526924611, 'mean_word_length': 3.152317880794702, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 42, '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': '4918818', 'n_tokens_mistral': 789, 'n_tokens_neox': 776, 'n_words': 187}