safe-react/src/routes/index.js
Adolfo Panizo 88bfca0a0d
WA-280 - Feature open created safes (#12)
* WA-280 Added redux logic for safe route

* WA-280 Added tests including builders for safe's redux store classes

* WA-280 Improving Flow coverage in actions and reducers

* WA- 280 Mocking LocalStorage and Web3 in JEST

* WA-280 Generating view of Safe route and its logic to store and retrieve info from localstorage

* WA-280 Added run-with-testrpc for simulating a testnet in memory while executing tests
2018-04-11 09:28:54 +02:00

38 lines
1.0 KiB
JavaScript

// @flow
import React from 'react'
import Loadable from 'react-loadable'
import { Switch, Redirect, Route } from 'react-router-dom'
import Loader from '~/components/Loader'
import Welcome from './welcome/container'
import { SAFELIST_ADDRESS, OPEN_ADDRESS, SAFE_PARAM_ADDRESS, WELCOME_ADDRESS } from './routes'
const Safe = Loadable({
loader: () => import('./safe/container'),
loading: Loader,
})
const SafeList = Loadable({
loader: () => import('./safeList/container'),
loading: Loader,
})
const Open = Loadable({
loader: () => import('./open/container/Open'),
loading: Loader,
})
const SAFE_ADDRESS = `${SAFELIST_ADDRESS}/:${SAFE_PARAM_ADDRESS}`
const Routes = () => (
<Switch>
<Redirect exact from="/" to={WELCOME_ADDRESS} />
<Route exact path={WELCOME_ADDRESS} component={Welcome} />
<Route exact path={OPEN_ADDRESS} component={Open} />
<Route exact path={SAFELIST_ADDRESS} component={SafeList} />
<Route exact path={SAFE_ADDRESS} component={Safe} />
</Switch>
)
export default Routes