<commit_before>import React, { PropTypes } from 'react'
import { List, ListItem } from 'material-ui/list';
import CircularProgress from 'material-ui/CircularProgress';
import FloatingActionButton from 'material-ui/FloatingActionButton';
import ContentAdd from 'material-ui/svg-icons/content/add';
import NewCharacterForm from './NewCharacterForm';
import { reduxForm } from 'redux-form';
import { Link } from 'react-router';

class Characters extends React.Component {
  componentDidMount() {
    this.props.fetchCharacters();
  }

  renderNewCharacterForm() {
    const {
      isCreatingNewCharacter,
      onNewCharacterConfirmed,
      onNewCharacterDiscarded
    } = this.props;

    if (!isCreatingNewCharacter) {
      return null;
    }

    return (
      <NewCharacterForm
        onSubmit={onNewCharacterConfirmed}
        onNewCharacterDiscarded={onNewCharacterDiscarded}
      />
    );
  }

  render() {
    const {
      isCreatingNewCharacter,
      onCharacterAddClicked,
      characters,
      isLoading
    } = this.props;

    if (isLoading) {
      return <CircularProgress size={2} />;
    }

    if (!characters.length) {
      return <h2>No Characters</h2>;
    }

    return (
      <div>
        <List>
          {characters.map((character) => {
            return (
              <ListItem
                key={character.name}
                primaryText={<Link to={`/characters/${character.name}`}>{character.name}</Link>}
              />
            );
          })}
        </List>
        {
          !isCreatingNewCharacter ?
          <FloatingActionButton onMouseDown={onCharacterAddClicked}>
            <ContentAdd />
          </FloatingActionButton> :
          null
        }
        {this.renderNewCharacterForm()}
      </div>
    )
  }
}

Characters.PropTypes = {
  characters: PropTypes.array,
  isLoading: PropTypes.bool,
  isCreatingNewCharacter: PropTypes.bool,
  onCharacterAddClicked: PropTypes.func,
  fetchCharacters: PropTypes.func
};

export default Characters;
<commit_msg>Use regular list items for link in character list<commit_after>import React, { PropTypes } from 'react'
import { List, ListItem } from 'material-ui/list';
import CircularProgress from 'material-ui/CircularProgress';
import FloatingActionButton from 'material-ui/FloatingActionButton';
import ContentAdd from 'material-ui/svg-icons/content/add';
import NewCharacterForm from './NewCharacterForm';
import { reduxForm } from 'redux-form';
import { withRouter } from 'react-router';

class Characters extends React.Component {
  componentDidMount() {
    this.props.fetchCharacters();
  }

  renderNewCharacterForm() {
    const {
      isCreatingNewCharacter,
      onNewCharacterConfirmed,
      onNewCharacterDiscarded
    } = this.props;

    if (!isCreatingNewCharacter) {
      return null;
    }

    return (
      <NewCharacterForm
        onSubmit={onNewCharacterConfirmed}
        onNewCharacterDiscarded={onNewCharacterDiscarded}
      />
    );
  }

  goToCharacter(name) {
    const { router } = this.props;
    router.push({
      pathname: `/characters/${name}`
    });
  }

  render() {
    const {
      isCreatingNewCharacter,
      onCharacterAddClicked,
      characters,
      isLoading
    } = this.props;

    if (isLoading) {
      return <CircularProgress size={2} />;
    }

    if (!characters.length) {
      return <h2>No Characters</h2>;
    }

    return (
      <div>
        <List>
          {characters.map((character) => {
            return (
              <ListItem
                key={character.name}
                primaryText={character.name}
                onTouchTap={this.goToCharacter.bind(this, character.name)}
              />
            );
          })}
        </List>
        {
          !isCreatingNewCharacter ?
          <FloatingActionButton onMouseDown={onCharacterAddClicked}>
            <ContentAdd />
          </FloatingActionButton> :
          null
        }
        {this.renderNewCharacterForm()}
      </div>
    )
  }
}

Characters.PropTypes = {
  characters: PropTypes.array,
  isLoading: PropTypes.bool,
  isCreatingNewCharacter: PropTypes.bool,
  onCharacterAddClicked: PropTypes.func,
  fetchCharacters: PropTypes.func
};

export default withRouter(Characters);

{'fraction_non_alphanumeric': 0.10842525228819526, 'fraction_numerical': 0.0014081201595869514, 'mean_word_length': 2.467860048820179, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '4034812', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1225, 'n_words': 222}