<commit_before>/** @jsx React.DOM */

var React = require('react');
var StoreMixin = require('fluxible-app').StoreMixin;

var AuthStore = require('../stores/AuthStore');

var loginAction = require('../actions/login');
var logoutAction = require('../actions/logout');

module.exports = React.createClass({
    mixins: [StoreMixin],
    statics: {
        storeListeners: [AuthStore]
    },
    getStateFromStores: function () {
        return {
            user    : this.getStore(AuthStore).getUser(),
            loading : this.getStore(AuthStore).isLoginInProgress()
        }
    },
    getInitialState: function () {
        return this.getStateFromStores();
    },
    render: function () {
        if (this.state.loading) {
            return (
                <div className="user-status loading">
                    Login in progress...
                </div>
            );
        } else if (this.state.user) {
            return (
                <div className="user-status authenticated">
                    <img src={this.state.user.picture.url} />
                    {this.state.user.firstName}
                     - <a onClick={this.logOut}>Log out</a><commit_msg>Make it work when user has not profile picture<commit_after>/** @jsx React.DOM */

var React = require('react');
var StoreMixin = require('fluxible-app').StoreMixin;

var AuthStore = require('../stores/AuthStore');

var loginAction = require('../actions/login');
var logoutAction = require('../actions/logout');

module.exports = React.createClass({
    mixins: [StoreMixin],
    statics: {
        storeListeners: [AuthStore]
    },
    getStateFromStores: function () {
        return {
            user    : this.getStore(AuthStore).getUser(),
            loading : this.getStore(AuthStore).isLoginInProgress()
        }
    },
    getInitialState: function () {
        return this.getStateFromStores();
    },
    render: function () {
        if (this.state.loading) {
            return (
                <div className="user-status loading">
                    Login in progress...
                </div>
            );
        } else if (this.state.user) {
            var pictureSrc = this.state.user.picture ? this.state.user.picture.url : null;

            return (
                <div className="user-status authenticated">
                    <img src={pictureSrc} />
                    {this.state.user.firstName}
                     - <a onClick={this.logOut}>Log out</a>
{'fraction_non_alphanumeric': 0.13610662358642972, 'fraction_numerical': 0.0, 'mean_word_length': 1.9038686987104338, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '4801099', 'n_tokens_mistral': 694, 'n_tokens_neox': 672, 'n_words': 134}