<commit_before>import React, { PropTypes } from 'react';

import '../Login.scss';

class Login extends React.Component {
  constructor () {
    super();

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

  componentWillMount () {
    this.props.retrieveUserFromSession();
  }

  handleUserLinkClick (e) {
    e.preventDefault();
    const { user } = this.props;
    const linkMethod = user.id ? this.props.logout : this.props.login;
    linkMethod();
  }

  getUserLink () {
    const { user } = this.props;
    const linkText = user.id ? 'Kirjaudu ulos' : 'Kirjaudu sisään';

    return (
      <a href='' className='navbar-link' onClick={this.handleUserLinkClick}>{linkText}</a>
    );
  }

  render () {
    return (
      <p className='navbar-text login-container'><commit_msg>Display users firstName on login-component<commit_after>import React, { PropTypes } from 'react';

import '../Login.scss';

class Login extends React.Component {
  constructor () {
    super();

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

  componentWillMount () {
    this.props.retrieveUserFromSession();
  }

  handleUserLinkClick (e) {
    e.preventDefault();
    const { user } = this.props;
    const linkMethod = user.id ? this.props.logout : this.props.login;
    linkMethod();
  }

  getUserLink () {
    const { user } = this.props;
    const linkText = user.id ? `${user.firstName}, <NAME>` : 'Kirjaudu sisään';

    return (
      <a href='' className='navbar-link' onClick={this.handleUserLinkClick}>{linkText}</a>
    );
  }

  render () {
    return (
      <p className='navbar-text login-container'>
{'fraction_non_alphanumeric': 0.14554275318374774, 'fraction_numerical': 0.0, 'mean_word_length': 3.2416452442159382, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '2752936', 'n_tokens_mistral': 539, 'n_tokens_neox': 522, 'n_words': 103}