<commit_before>import * as React from "react";
import {Link} from "react-router";
import sessionStore from "../../../stores/sessionStore";


/**
 * INavbarAdminState defines the state of the NavbarAdmin component.
 */
export interface INavbarAdminState {
    userEmail : string;
}

/**
 * This class represents the admin navbar.
 *
 * @history
 * | Author           | Action Performed               | Data       |
 * |------------------|--------------------------------|------------|
 * | <NAME>    | Create interfaces and class    | 06/06/2016 |
 *
 * @author  <NAME>
 * @license MIT
 *
 */
class NavbarAdmin extends React.Component<void, INavbarAdminState> {

    /**
     * @description Default constructor.
     * @return {NavbarAdmin}
     */
    constructor() {
        super();
        this.state = {
            userEmail: sessionStore.getEmail()
        };
        this._onChange = this._onChange.bind(this);
    }

    /**
     * @description
     * <p>Render method of the component.
     * It renders the admin navbar.</p>
     * @return {JSX.Element}
     */
    public render() : JSX.Element {
        /* tslint:disable: max-line-length */
        return(
            <nav>
                <div className="nav-wrapper grey darken-3">
                    <ul id="nav-mobile" className="right">
                        <li><Link to="/Profile">{this.state.userEmail}</Link></li>
                        <li><Link to="/Logout">Logout</Link></li>
                    </ul>
                    <ul id="nav-mobile" className="left">
                        <li><Link to="/Home">Home</Link></li>
                        <li><Link to="/Dashboard">Dashboard</Link></li>
                        <li><Link to="/Collection">Collection</Link></li>
                        <li><Link to="/Editor">Editor</Link></li>
                    </ul>
                </div>
            </nav>
        );
        /* tslint:enable: max-line-length */
    }

    /**
     * @description This method is called when the component mount.
     */
    private componentDidMount() : void {
        sessionStore.addChangeListener(this._onChange);
    }

    /**
     * @description This method is called when the component unmount.
     */
    private componentWillUnmount() : void {
        sessionStore.removeChangeListener(this._onChange);
    }

    /**
     * @description This method is called every time the store change.
     */
    private _onChange() : void {
        this.setState ({
            userEmail: sessionStore.getEmail()
        });
    }
}

export default NavbarAdmin;
<commit_msg>Add navbarLink<commit_after>import * as React from "react";
import {Link} from "react-router";
import sessionStore from "../../../stores/sessionStore";


/**
 * INavbarAdminState defines the state of the NavbarAdmin component.
 */
export interface INavbarAdminState {
    userEmail : string;
}

/**
 * This class represents the admin navbar.
 *
 * @history
 * | Author           | Action Performed               | Data       |
 * |------------------|--------------------------------|------------|
 * | <NAME>    | Create interfaces and class    | 06/06/2016 |
 *
 * @author  <NAME>
 * @license MIT
 *
 */
class NavbarAdmin extends React.Component<void, INavbarAdminState> {

    /**
     * @description Default constructor.
     * @return {NavbarAdmin}
     */
    constructor() {
        super();
        this.state = {
            userEmail: sessionStore.getEmail()
        };
        this._onChange = this._onChange.bind(this);
    }

    /**
     * @description
     * <p>Render method of the component.
     * It renders the admin navbar.</p>
     * @return {JSX.Element}
     */
    public render() : JSX.Element {
        /* tslint:disable: max-line-length */
        return(
            <nav>
                <div className="nav-wrapper grey darken-3">
                    <ul id="nav-mobile" className="right">
                        <li><Link to="/Profile">{this.state.userEmail}</Link></li>
                        <li><Link to="/Logout">Logout</Link></li>
                    </ul>
                    <ul id="nav-mobile" className="left">
                        <li><Link to="/Home">Home</Link></li>
                        <li><Link to="/Dashboard">Dashboard</Link></li>
                        <li><Link to="/Collection">Collection</Link></li>
                        <li><Link to="/Editor">Editor</Link></li>
                        <li><Link to="/Members">Members</Link></li>
                    </ul>
                </div>
            </nav>
        );
        /* tslint:enable: max-line-length */
    }

    /**
     * @description This method is called when the component mount.
     */
    private componentDidMount() : void {
        sessionStore.addChangeListener(this._onChange);
    }

    /**
     * @description This method is called when the component unmount.
     */
    private componentWillUnmount() : void {
        sessionStore.removeChangeListener(this._onChange);
    }

    /**
     * @description This method is called every time the store change.
     */
    private _onChange() : void {
        this.setState ({
            userEmail: sessionStore.getEmail()
        });
    }
}

export default NavbarAdmin;

{'fraction_non_alphanumeric': 0.15937320848461686, 'fraction_numerical': 0.0034397095356392127, 'mean_word_length': 1.650126582278481, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, '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': '4669003', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1393, 'n_words': 317}