diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-22 17:19:33 +0100 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-22 17:19:37 +0100 |
commit | 936f7e32781f2d90fa3e3460758005d807fa6120 (patch) | |
tree | 1f07ac11edfad755bc30acff9ce605b9c8ff8967 /frontend/src/routes.js | |
parent | Fix areAllPlayersReady() to understand WAIT action (diff) | |
download | seven-wonders-936f7e32781f2d90fa3e3460758005d807fa6120.tar.gz seven-wonders-936f7e32781f2d90fa3e3460758005d807fa6120.tar.bz2 seven-wonders-936f7e32781f2d90fa3e3460758005d807fa6120.zip |
Move saga and router routes in a single file
Diffstat (limited to 'frontend/src/routes.js')
-rw-r--r-- | frontend/src/routes.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/frontend/src/routes.js b/frontend/src/routes.js new file mode 100644 index 00000000..25e849de --- /dev/null +++ b/frontend/src/routes.js @@ -0,0 +1,31 @@ +import usernameChoiceSaga from './sagas/usernameChoice' +import gameBrowserSaga from './sagas/gameBrowser' + +export const makeSagaRoutes = wsConnection => ({ + *'/'() { + yield usernameChoiceSaga(wsConnection) + }, + *'/games'() { + yield gameBrowserSaga(wsConnection) + } +}) + +import { LobbyLayout } from './layouts' +import HomePage from './containers/home' +import GameBrowser from './containers/gameBrowser' +import Error404 from './components/errors/Error404' + +export const routes = [ + { + path: '/', + component: LobbyLayout, + indexRoute: { component: HomePage }, + childRoutes: [ + { path: '/games', component: GameBrowser } + ] + }, + { + path: '*', + component: Error404, + } +] |