<commit_before>// npm packages
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {push} from 'react-router-redux';

// our components
import {Navbar} from '../../components';

const mapStateToProps = state => ({
  actualPath: state.routing.locationBeforeTransitions && state.routing.locationBeforeTransitions.pathname,
  user: state.auth.user,
  token: state.auth.token,
});

const mapDispatchToProps = dispatch => ({
  navTo: path => dispatch(push(path)),
});

class App extends React.Component {
  static propTypes = {
    token: PropTypes.string,
    user: PropTypes.shape({
      email: PropTypes.string.isRequired,
      id: PropTypes.string.isRequired,
      login: PropTypes.string.isRequired,
      name: PropTypes.string.isRequired,
      registrationDate: PropTypes.string.isRequired,
      surname: PropTypes.string.isRequired,
    }),
    navTo: PropTypes.func.isRequired,
  };

  componentWillReceiveProps(nextProps) {
    if (this.props.token !== nextProps.token) {
      if (nextProps.token) {
        return this.props.navTo('/');
      }
      return this.props.navTo('/home');
    }
  }

  render() {
    const {children, user, token} = this.props;
    return (
      <div>
        <Navbar {...this.props} />
        <div className="container">
          {children}
        </div>
      </div>
    );
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(App);<commit_msg>[client] Fix error: notifications didn't show<commit_after>// npm packages
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {push} from 'react-router-redux';

// our components
import {Navbar} from '../../components';
import Footer from '../../components/footer';

const mapStateToProps = state => ({
  actualPath: state.routing.locationBeforeTransitions && state.routing.locationBeforeTransitions.pathname,
  user: state.auth.user,
  token: state.auth.token,
});

const mapDispatchToProps = dispatch => ({
  navTo: path => dispatch(push(path)),
});

class App extends React.Component {
  static propTypes = {
    token: PropTypes.string,
    user: PropTypes.shape({
      email: PropTypes.string.isRequired,
      id: PropTypes.string.isRequired,
      login: PropTypes.string.isRequired,
      name: PropTypes.string.isRequired,
      registrationDate: PropTypes.string.isRequired,
      surname: PropTypes.string.isRequired,
    }),
    navTo: PropTypes.func.isRequired,
  };

  componentWillReceiveProps(nextProps) {
    if (this.props.token !== nextProps.token) {
      if (nextProps.token) {
        return this.props.navTo('/');
      }
      return this.props.navTo('/home');
    }
  }

  render() {
    const {children, user, token} = this.props;
    return (
      <div>
        <Navbar {...this.props} />
        <div className="container">
          {children}
          <Footer />
        </div>
      </div>
    );
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(App);
{'fraction_non_alphanumeric': 0.14160780356542213, 'fraction_numerical': 0.0, 'mean_word_length': 3.0964187327823693, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 20, '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': '2250709', 'n_tokens_mistral': 888, 'n_tokens_neox': 901, 'n_words': 191}