<commit_before>/* global API_HOST */
import React from 'react';
import FlatButton from 'material-ui/FlatButton';
import ActionUpdate from 'material-ui/svg-icons/action/update';
import strings from 'lang';
import fetch from 'isomorphic-fetch';
import styles from './PlayerButtons.css';

class PlayerButtons extends React.Component {
  componentWillMount() {
    this.setState({ disableRefresh: false });
  }

  render() {
    const { playerId,
            playerSoloCompetitiveRank,
          } = this.props;
    return (
      <div className={styles.container}>
        <div
          className={styles.refreshButton}
          data-hint={strings.app_refresh}
          data-hint-position="top"
        >
          <FlatButton
            icon={<ActionUpdate />}
            disabled={this.state.disableRefresh}
            onClick={() => {
              fetch(`${API_HOST}/api/players/${playerId}/refresh`, { method: 'POST' });
              this.setState({ disableRefresh: true });
            }}
          />
        </div>
        <FlatButton
        // not working until dotacoach supports passing player only data (no match data here)
          disabled
          label={strings.app_dotacoach}
          labelPosition="after"
          icon={<img src="/assets/images/dotacoach-32x24.png" alt="DotaCoach" />}
          style={{ marginLeft: 15 }}
          href={`https://dotacoach.org/Hire/Yasp?userSteamId=${playerId}&playerMmr=${playerSoloCompetitiveRank}`}
        />
      </div>);
  }
}

export default PlayerButtons;<commit_msg>enable dotacoach<commit_after>/* global API_HOST */
import React from 'react';
import FlatButton from 'material-ui/FlatButton';
import ActionUpdate from 'material-ui/svg-icons/action/update';
import strings from 'lang';
import fetch from 'isomorphic-fetch';
import styles from './PlayerButtons.css';

class PlayerButtons extends React.Component {
  componentWillMount() {
    this.setState({ disableRefresh: false });
  }

  render() {
    const { playerId,
            playerSoloCompetitiveRank,
          } = this.props;
    return (
      <div className={styles.container}>
        <div
          className={styles.refreshButton}
          data-hint={strings.app_refresh}
          data-hint-position="top"
        >
          <FlatButton
            icon={<ActionUpdate />}
            disabled={this.state.disableRefresh}
            onClick={() => {
              fetch(`${API_HOST}/api/players/${playerId}/refresh`, { method: 'POST' });
              this.setState({ disableRefresh: true });
            }}
          />
        </div>
        <FlatButton
          label={strings.app_dotacoach}
          labelPosition="after"
          icon={<img src="/assets/images/dotacoach-32x24.png" alt="DotaCoach" />}
          style={{ marginLeft: 15 }}
          href={`https://dotacoach.org/Hire/OpenDota?userSteamId=${playerId}&playerMmr=${playerSoloCompetitiveRank}`}
        />
      </div>);
  }
}

export default PlayerButtons;
{'fraction_non_alphanumeric': 0.13458950201884254, 'fraction_numerical': 0.004037685060565276, 'mean_word_length': 2.436994219653179, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '2227377', 'n_tokens_mistral': 838, 'n_tokens_neox': 840, 'n_words': 158}