<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import {
  getUserAsync,
  facebookLoginAsync
} from '../../actions/user-action-creators';

import style from './Login.scss';
import classNames from 'classnames/bind';

const css = classNames.bind(style);

class Login extends Component {

  constructor(props) {
    super(props);
    props.getUserAsync();

    this.onFacebookLogin = this.onFacebookLogin.bind(this);
  }

  onFacebookLogin(e) {
    this.props.facebookLoginAsync();
  }

  render () {
    const { user } = this.props;
    return (
      <div className={ css('login') }>
        <input type="checkbox" className={ css('status-check') } id="status" />
        <label className={ css('status') } htmlFor="status">
          { user.res && user.res.name ? user.res.name : 'Login' }
        </label>
        <ul className={ css('social-menu') }>
          <li className={ css('fb-btn') } onClick={this.onFacebookLogin}>Facebook</li>
        </ul>
      </div>
    );
  }<commit_msg>user name fixed<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import {
  getUserAsync,
  facebookLoginAsync
} from '../../actions/user-action-creators';

import style from './Login.scss';
import classNames from 'classnames/bind';

const css = classNames.bind(style);

class Login extends Component {

  constructor(props) {
    super(props);
    props.getUserAsync();

    this.onFacebookLogin = this.onFacebookLogin.bind(this);
  }

  onFacebookLogin(e) {
    this.props.facebookLoginAsync();
  }

  userNameFixed(name) {
    return name.split(' ', 2).join(' ').slice(0, 13);
  }

  render () {
    const { user } = this.props;
    return (
      <div className={ css('login') }>
        <input type="checkbox" className={ css('status-check') } id="status" />
        <label className={ css('status') } htmlFor="status">
          { user.res && user.res.name ? this.userNameFixed(user.res.name) : 'Login' }
        </label>
        <ul className={ css('social-menu') }>
          <li className={ css('fb-btn') } onClick={this.onFacebookLogin}>Facebook</li>
        </ul>
      </div>
    );
  }
{'fraction_non_alphanumeric': 0.16615249008373734, 'fraction_numerical': 0.0017628911414720142, 'mean_word_length': 3.11978221415608, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4305928', 'n_tokens_mistral': 722, 'n_tokens_neox': 698, 'n_words': 150}