<commit_before>var React = require('react');
var Router = require('react-router');
var {Routes, Route} = Router;

var Login = require('./components/login/index.jsx');
var User = require('./components/mixins/user');
var Nav = require('./components/nav/index.jsx');
var Messages = require('./components/messages/index.jsx');
var MessagesView = require('./components/messages-view/index.jsx');
var SearchView = require('./components/search-view/index.jsx');
var auth = require('./auth')();

require('./new-user-maker')();
require('./styles.less');

var App = React.createClass({
  mixins: [User],

  getInitialState: function() {
    return {};
  },

  render: function() {
    var content;

    if (this.state.isLoggedIn)
      content = this.props.activeRouteHandler();
    else if (this.state.hasOwnProperty('isLoggedIn'))
      content = <div className='col-xs-offset-3 col-xs-6'><Login /></div>;

    return <div className='app'>
      <Nav loggedIn={!!this.state.user} />
      <div className='container'>
        {content}
      </div>
    </div>;
  }
});

// if we're deployed to gh-pages, then we need to use hash routing since it's
// just a simple static file server
var loc = /^\/irked\//.test(location.pathname)? 'hash' : 'history';

React.renderComponent(<Routes location={loc}>
  <Route                          handler={App}>
    <Route                        handler={MessagesView} name='home' />
    <Route path={'message/:date'} handler={MessagesView} name='message' />
    <Route path={'search'}        handler={SearchView}   name='search' />
  </Route>
</Routes>, document.body);

window.React = React;<commit_msg>routing is hard to get rite<commit_after>var React = require('react');
var Router = require('react-router');
var {Routes, Route} = Router;

var Login = require('./components/login/index.jsx');
var User = require('./components/mixins/user');
var Nav = require('./components/nav/index.jsx');
var Messages = require('./components/messages/index.jsx');
var MessagesView = require('./components/messages-view/index.jsx');
var SearchView = require('./components/search-view/index.jsx');
var auth = require('./auth')();

require('./new-user-maker')();
require('./styles.less');

var App = React.createClass({
  mixins: [User],

  getInitialState: function() {
    return {};
  },

  render: function() {
    var content;

    if (this.state.isLoggedIn)
      content = this.props.activeRouteHandler();
    else if (this.state.hasOwnProperty('isLoggedIn'))
      content = <div className='col-xs-offset-3 col-xs-6'><Login /></div>;

    return <div className='app'>
      <Nav loggedIn={!!this.state.user} />
      <div className='container'>
        {content}
      </div>
    </div>;
  }
});

// if we're deployed to gh-pages, then we need to use hash routing since it's
// just a simple static file server
var loc = /^\/irked\//.test(location.pathname)? 'hash' : 'history';

React.renderComponent(<Routes location={loc}>
  <Route                          handler={App}>
    <Route path={'/'}             handler={MessagesView} name='home' />
    <Route path={'message/:date'} handler={MessagesView} name='message' />
    <Route                        handler={SearchView}   name='search' />
  </Route>
</Routes>, document.body);

window.React = React;
{'fraction_non_alphanumeric': 0.18273337400854178, 'fraction_numerical': 0.0012202562538133007, 'mean_word_length': 3.2918848167539267, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '451925', 'n_tokens_mistral': 997, 'n_tokens_neox': 985, 'n_words': 228}