diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-07-31 18:44:01 +0200 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-08-07 22:41:20 +0200 |
commit | be86c9d23cdae888598e1f7de7812d7e0f1ca12c (patch) | |
tree | f39e95e3e8781c336b6221ce91c557d9e7e84fb0 /frontend/src/routes.js | |
parent | Updrade react router and react router redux (diff) | |
download | seven-wonders-be86c9d23cdae888598e1f7de7812d7e0f1ca12c.tar.gz seven-wonders-be86c9d23cdae888598e1f7de7812d7e0f1ca12c.tar.bz2 seven-wonders-be86c9d23cdae888598e1f7de7812d7e0f1ca12c.zip |
Refactor routes to new structure
Diffstat (limited to 'frontend/src/routes.js')
-rw-r--r-- | frontend/src/routes.js | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/frontend/src/routes.js b/frontend/src/routes.js index b87977ef..60efed8d 100644 --- a/frontend/src/routes.js +++ b/frontend/src/routes.js @@ -1,23 +1,32 @@ // @flow -import { HomeLayout, LobbyLayout } from './layouts'; -import GameBrowser from './containers/gameBrowser'; -import HomePage from './containers/home'; -import Lobby from './containers/lobby'; +import React from 'react'; + +import Application from './scenes'; import Error404 from './components/errors/Error404'; -export const routes = [ - { - path: '/', - component: HomeLayout, - indexRoute: { component: HomePage }, - }, - { - path: '/', - component: LobbyLayout, - childRoutes: [{ path: '/games', component: GameBrowser }, { path: '/lobby/*', component: Lobby }], - }, - { - path: '*', - component: Error404, - }, -]; +import { Route, Switch } from 'react-router'; + +const Routes = () => ( + <Switch> + <Route path="/" component={Application} /> + <Route path="*" component={Error404} /> + </Switch> +); + +export default Routes; +// export const routes = [ +// { +// path: '/', +// component: HomeLayout, +// indexRoute: { component: HomePage }, +// }, +// { +// path: '/', +// component: LobbyLayout, +// childRoutes: [{ path: '/games', component: GameBrowser }, { path: '/lobby/*', component: Lobby }], +// }, +// { +// path: '*', +// component: Error404, +// }, +// ]; |