/**
 * Routes
 * @flow
 */
import React from 'react'
import { IndexRoute, Route } from 'react-router'

// Queries
import ViewerQueries from '@client/queries/ViewerQueries'
import BikeshedQueries from '@client/queries/BikeshedQueries'

// Components
import { AppContainer } from '@client/containers/App'
import { BikeshedCreatorContainer } from '@client/containers/BikeshedCreator'
import { BikeshedExplorerContainer } from '@client/containers/BikeshedExplorer'
import { BikeshedViewerContainer } from '@client/containers/BikeshedViewer'

export default (
  <Route
    path='/'
    component={AppContainer}
    queries={ViewerQueries}
  >
    <IndexRoute
      component={BikeshedCreatorContainer}
      queries={ViewerQueries}
    />

    <Route
      path='/bikesheds'
    >
      <IndexRoute
        component={BikeshedExplorerContainer}
      />
      <Route
        path=':bikeshedId'
        component={BikeshedViewerContainer}
        queries={BikeshedQueries}
      />
    </Route>
  </Route>
)

@@ -9,18 +9,20 @@
 oute
-s%0A * @flow
+ definitions
 %0A */
@@ -56,16 +56,31 @@
 import %7B
+ IndexRedirect,
  IndexRo
@@ -116,21 +116,19 @@
 er'%0A%0A// 
-Queri
+Pag
 es%0Aimpor
@@ -133,88 +133,57 @@
 ort 
-ViewerQueries
+Home
  from '
-@
 client/
-queries/ViewerQueries'%0Aimport BikeshedQuerie
+pages/Home'%0Aimport Term
 s from '
 @cli
@@ -182,116 +182,34 @@
 om '
-@
 client/
-queries/BikeshedQueries'%0A%0A// Components%0Aimport %7B AppContainer %7D from '@client/containers/App
+pages/Terms
 '%0Aimport
  %7B B
@@ -196,34 +196,32 @@
 es/Terms'%0Aimport
- %7B
  BikeshedCreator
@@ -217,50 +217,32 @@
 shed
-CreatorContain
+View
 er
- %7D
  from '
-@
 client/
-container
+page
 s/Bi
@@ -251,103 +251,91 @@
 shed
-Creator'%0Aimport %7B BikeshedExplorerContainer %7D
+Viewer'%0A%0A// Queries%0Aimport ViewerQueries
  from '
-@
 client/
-containers/BikeshedExplorer
+queries/ViewerQueries
 '%0Aimport
  %7B B
@@ -330,18 +330,16 @@
 '%0Aimport
- %7B
  Bikeshe
@@ -343,49 +343,35 @@
 shed
-ViewerContainer %7D
+Queries
  from '
-@
 client/
-container
+querie
 s/Bi
@@ -376,22 +376,23 @@
 Bikeshed
-Viewer
+Queries
 '%0A%0Aexpor
@@ -429,65 +429,8 @@
 '/'%0A
-    component=%7BAppContainer%7D%0A    queries=%7BViewerQueries%7D%0A
   %3E%0A
@@ -466,32 +466,12 @@
 nt=%7B
-BikeshedCreatorContainer
+Home
 %7D%0A  
@@ -516,22 +516,16 @@
   %3CRoute
-%0A     
  path='/
@@ -538,22 +538,48 @@
 eds'
+%3E
 %0A    
-%3E
+  %3CIndexRedirect to='/'/%3E%0A
 %0A      %3C
 Inde
@@ -570,29 +570,24 @@
 '/%3E%0A%0A      %3C
-Index
 Route%0A      
@@ -611,57 +611,24 @@
 shed
-ExplorerContain
+View
 er%7D%0A   
- 
-  /%3E%0A      %3CRoute%0A
      
-   
 path
@@ -646,33 +646,31 @@
 Id'%0A        
-component
+queries
 =%7BBikeshedVi
@@ -671,79 +671,100 @@
 shed
-ViewerContainer%7D%0A        queries=%7BBikeshedQueries%7D%0A      /%3E%0A    %3C/Route
+Queries%7D%0A      /%3E%0A    %3C/Route%3E%0A%0A    %3CRoute%0A      component=%7BTerms%7D%0A      path='/terms'%0A    /
 %3E%0A  

Update client routes