content: "use strict";
  import 'babel/polyfill';
  
  import React from 'react';
  import ReactDOM from 'react-dom';
  import Relay from 'react-relay';
  import injectTapEventPlugin from 'react-tap-event-plugin';
  
  import {Router, Route, IndexRoute} from 'react-router';
  import {RelayRouter} from 'react-router-relay';
  import createBrowserHistory from 'history/lib/createBrowserHistory'
  
  import RootQuery from './queries/root-query';
  import TroopQuery from './queries/troop-query';
  import CurrentUserQuery from './queries/current-user-query';
  
  import AppLayout from './components/AppLayout';
  import App from './components/App';
  import Troop from './components/Troop';
  import Login from './components/Login';
  import Profile from './components/Profile';
  
  //Needed for onTouchTap
  //Can go away when react 1.0 release
  //Check this repo:
  //https://github.com/zilverline/react-tap-event-plugin
  injectTapEventPlugin();
  
  Relay.injectNetworkLayer(
    new Relay.DefaultNetworkLayer('/graphql', {
      credentials: 'same-origin',
    })
  );
  
  setTimeout(() => {
    ReactDOM.render(
      <RelayRouter
        history={createBrowserHistory()}>
        <Route path='/' component={AppLayout}>
          <IndexRoute
              component={App}
              queries={RootQuery} />
          <Route queries={RootQuery} component={App}>
            <Route path='login'
              component={Login} 
              queries={RootQuery} />
          </Route>
          <Route
            path='troop/:id'
            component={Troop}
            queries={TroopQuery} />
          <Route
            path='profile'
            component={Profile}
            queries={CurrentUserQuery} />
        </Route>
      </RelayRouter>,
      document.getElementById('root')
    );
  }, 0);
  