p5.js-web-editor/shared/routes.js

23 lines
664 B
JavaScript
Raw Normal View History

2016-05-18 19:37:59 +02:00
import { Route, IndexRoute } from 'react-router'
import React from 'react'
import App from './containers/App'
import IDEView from './containers/IDEView/IDEView'
2016-05-24 07:20:59 +02:00
import LoginView from './containers/LoginView/LoginView'
import SignupView from './containers/SignupView/SignupView'
import { getUser } from './redux/actions/user';
2016-05-18 19:37:59 +02:00
const routes = (store) => {
return (
<Route path="/" component={App}>
<IndexRoute component={IDEView} onEnter={checkAuth(store)}/>
<Route path="/login" component={LoginView}/>
<Route path="/signup" component={SignupView}/>
</Route>
);
}
const checkAuth = (store) => {
store.dispatch(getUser());
}
2016-05-18 19:37:59 +02:00
export default routes;