<commit_before>import React, { Component, PropTypes } from 'react';
import TitleBar from './TitleBar';
import styles from './Settings.module.css';
import titleBarStyles from './TitleBar.module.css';
import { miliToMin, minToMili } from '../../common/conversion';
import { Link } from 'react-router';

class Settings extends Component {
  static propTypes = {
    setWorkDuration: PropTypes.func.isRequired,
    setShortBreakDuration: PropTypes.func.isRequired,
    setLongBreakDuration: PropTypes.func.isRequired,
    setSetCount: PropTypes.func.isRequired,
    timer: PropTypes.object.isRequired,
    settings: PropTypes.object.isRequired
  };


  setTime(cb, event) {
    return cb(minToMili(parseFloat(event.target.value) || 0));
  }

  setSetCount(event) {
    return this.props.setSetCount(parseFloat(event.target.value) || 0);
  }

  render() {
    const { settings, timer, setWorkDuration, setShortBreakDuration, setLongBreakDuration } = this.props;

    return (
        <div className={styles.container}>
        <TitleBar>
          <div className={titleBarStyles['title-bar-container']}>
            <div className={titleBarStyles['title-bar-left']}>
              <Link className={timer.running ? styles['title-bar-back-running'] : styles['title-bar-back-paused']} to="/" query={{ transition: 'slide-right' }} />
            </div>
            <div className={titleBarStyles['title-bar-center']}>
              <h3 className={styles.heading}>Settings</h3>
            </div>
            <div className={titleBarStyles['title-bar-right']}>
            </div>
          </div>
        </TitleBar>


        <div className={styles['input-container']}>
          <label className={styles.label}>Work:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              onChange={this.setTime.bind(this, setWorkDuration)}
              defaultValue={miliToMin(settings.workDuration)} />
          </label>
        </div>
        <div className={styles['input-container']}>
          <label className={styles.label}>Short Break:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              onChange={this.setTime.bind(this, setShortBreakDuration)}
              defaultValue={miliToMin(settings.shortBreakDuration)} />
          </label>
        </div>
        <div className={styles['input-container']}>
          <label className={styles.label}>Long Break:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              onChange={this.setTime.bind(this, setLongBreakDuration)}
              defaultValue={miliToMin(settings.longBreakDuration)} />
          </label>
        </div>
        <div className={styles['input-container']}>
          <label className={styles.label}>Set Count:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              max="6"
              onChange={this.setSetCount.bind(this)}
              defaultValue={settings.setCount} />
          </label>
        </div>
      </div>
    );
  }
}

export default Settings;
<commit_msg>Update max set<commit_after>import React, { Component, PropTypes } from 'react';
import TitleBar from './TitleBar';
import styles from './Settings.module.css';
import titleBarStyles from './TitleBar.module.css';
import { miliToMin, minToMili } from '../../common/conversion';
import { Link } from 'react-router';

class Settings extends Component {
  static propTypes = {
    setWorkDuration: PropTypes.func.isRequired,
    setShortBreakDuration: PropTypes.func.isRequired,
    setLongBreakDuration: PropTypes.func.isRequired,
    setSetCount: PropTypes.func.isRequired,
    timer: PropTypes.object.isRequired,
    settings: PropTypes.object.isRequired
  };


  setTime(cb, event) {
    return cb(minToMili(parseFloat(event.target.value) || 0));
  }

  setSetCount(event) {
    return this.props.setSetCount(parseFloat(event.target.value) || 0);
  }

  render() {
    const { settings, timer, setWorkDuration, setShortBreakDuration, setLongBreakDuration } = this.props;

    return (
        <div className={styles.container}>
        <TitleBar>
          <div className={titleBarStyles['title-bar-container']}>
            <div className={titleBarStyles['title-bar-left']}>
              <Link className={timer.running ? styles['title-bar-back-running'] : styles['title-bar-back-paused']} to="/" query={{ transition: 'slide-right' }} />
            </div>
            <div className={titleBarStyles['title-bar-center']}>
              <h3 className={styles.heading}>Settings</h3>
            </div>
            <div className={titleBarStyles['title-bar-right']}>
            </div>
          </div>
        </TitleBar>


        <div className={styles['input-container']}>
          <label className={styles.label}>Work:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              onChange={this.setTime.bind(this, setWorkDuration)}
              defaultValue={miliToMin(settings.workDuration)} />
          </label>
        </div>
        <div className={styles['input-container']}>
          <label className={styles.label}>Short Break:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              onChange={this.setTime.bind(this, setShortBreakDuration)}
              defaultValue={miliToMin(settings.shortBreakDuration)} />
          </label>
        </div>
        <div className={styles['input-container']}>
          <label className={styles.label}>Long Break:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              onChange={this.setTime.bind(this, setLongBreakDuration)}
              defaultValue={miliToMin(settings.longBreakDuration)} />
          </label>
        </div>
        <div className={styles['input-container']}>
          <label className={styles.label}>Set Count:
            <input
              className={styles.input}
              type="number"
              step="1"
              min="1"
              max="4"
              onChange={this.setSetCount.bind(this)}
              defaultValue={settings.setCount} />
          </label>
        </div>
      </div>
    );
  }
}

export default Settings;

{'fraction_non_alphanumeric': 0.1373234087801914, 'fraction_numerical': 0.003949567066686921, 'mean_word_length': 2.1457238413760154, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 73, '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': '3918997', 'n_tokens_mistral': 1769, 'n_tokens_neox': 1782, 'n_words': 306}