You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

import React from 'react';
import Router, {Route} from 'react-router';
import AuthenticatedApp from './components/AuthenticatedApp'
import Login from './components/Login';
import Signup from './components/Signup';
import Home from './components/Home';
import Quote from './components/Quote';
import Account from './components/Account';
9 years ago
import Tx from './components/Tx';
import RouterContainer from './services/RouterContainer';
import LoginActions from './actions/LoginActions';
var routes = (
<Route handler={AuthenticatedApp}>
<Route name="login" handler={Login}/>
<Route name="signup" handler={Signup}/>
<Route name="home" path="/" handler={Home}/>
<Route name="quote" handler={Quote}/>
<Route name="account" handler={Account}>
<Route path="txs/:accountId" handler={Tx}/>
</Route>
</Route>
);
var router = Router.create({routes});
RouterContainer.set(router);
let jwt = localStorage.getItem('jwt');
if (jwt) {
LoginActions.loginUser(jwt);
}
router.run(function (Handler) {
React.render(<Handler />, document.getElementById('content'));
});