summaryrefslogtreecommitdiff
path: root/frontend/src/routes.js
blob: 25e849de7a7c06cd9d32dbf137d348d32ab17961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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,
  }
]
bgstack15