<commit_before>/*
 * @flow
 */

import React from 'react';

import {
  Link
} from 'react-router';

import styles from './headernav.module.css';

import AuthService from '../../utils/AuthService';
import PageConsts from '../../utils/Consts/PageConsts';

class HeaderNav extends React.Component {

  onLogoutClick = () => {
    this.props.auth.logout();
  }

  render() {

    const greeting = (this.props.name && this.props.name.length)
      ? `Hi, ${this.props.name}!`
      : 'Hi!';

    const settingsNavItemClassNames = (this.props.isAdmin)
      ? styles.headerNavItem
      : `${styles.headerNavItem} ${styles.hidden}`;

    return (
      <header className={styles.headerNavWrapper}>
        <nav className={styles.headerNav}>

          <div className={styles.headerNavLeft}>
            <h2 className={`${styles.headerNavItem} ${styles.loom}`}>LOOM</h2>
          </div>

          <div className={styles.headerNavRight}>
            <div className={styles.headerNavItem}>
              { greeting }
            </div>
            <div className={styles.headerNavItem}>
              <Link
                  to={`/${PageConsts.LOGIN}`}
                  className={styles.headerNavLink}
                  onClick={this.onLogoutClick}>
                Logout
              </Link>
            </div>
          </div>

        </nav>
      </header>
    );
  }
}

HeaderNav.propTypes = {
  auth: React.PropTypes.instanceOf(AuthService),
  isAdmin: React.PropTypes.bool,
  name: React.PropTypes.string
};

export default HeaderNav;
<commit_msg>Add temp link to profile via headerNav greeting<commit_after>/*
 * @flow
 */

import React from 'react';

import {
  Link
} from 'react-router';

import styles from './headernav.module.css';

import AuthService from '../../utils/AuthService';
import PageConsts from '../../utils/Consts/PageConsts';

class HeaderNav extends React.Component {

  onLogoutClick = () => {
    this.props.auth.logout();
  }

  render() {

    const greeting = (this.props.name && this.props.name.length)
      ? <span>Hi, <Link to={`/${PageConsts.EDIT_PROFILE}`}>{this.props.name}</Link>!</span>
      : 'Hi!';

    const settingsNavItemClassNames = (this.props.isAdmin)
      ? styles.headerNavItem
      : `${styles.headerNavItem} ${styles.hidden}`;

    return (
      <header className={styles.headerNavWrapper}>
        <nav className={styles.headerNav}>

          <div className={styles.headerNavLeft}>
            <h2 className={`${styles.headerNavItem} ${styles.loom}`}>LOOM</h2>
          </div>

          <div className={styles.headerNavRight}>
            <div className={styles.headerNavItem}>
              { greeting }
            </div>
            <div className={styles.headerNavItem}>
              <Link
                  to={`/${PageConsts.LOGIN}`}
                  className={styles.headerNavLink}
                  onClick={this.onLogoutClick}>
                Logout
              </Link>
            </div>
          </div>

        </nav>
      </header>
    );
  }
}

HeaderNav.propTypes = {
  auth: React.PropTypes.instanceOf(AuthService),
  isAdmin: React.PropTypes.bool,
  name: React.PropTypes.string
};

export default HeaderNav;

{'fraction_non_alphanumeric': 0.14871634314339385, 'fraction_numerical': 0.0012523481527864746, 'mean_word_length': 2.217522658610272, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, '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': '6423198', 'n_tokens_mistral': 964, 'n_tokens_neox': 952, 'n_words': 170}