2017-07-04 03:28:56 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Provider } from 'react-redux';
|
2017-09-08 16:57:50 +00:00
|
|
|
import { Router, Redirect, Route } from 'react-router';
|
2017-04-14 06:21:22 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2017-09-08 16:57:50 +00:00
|
|
|
import { App } from 'containers';
|
|
|
|
import GenerateWallet from 'containers/Tabs/GenerateWallet';
|
|
|
|
import ViewWallet from 'containers/Tabs/ViewWallet';
|
|
|
|
import Help from 'containers/Tabs/Help';
|
|
|
|
import Swap from 'containers/Tabs/Swap';
|
|
|
|
import SendTransaction from 'containers/Tabs/SendTransaction';
|
|
|
|
import Contracts from 'containers/Tabs/Contracts';
|
|
|
|
import ENS from 'containers/Tabs/ENS';
|
2017-04-12 05:04:27 +00:00
|
|
|
|
|
|
|
export default class Root extends Component {
|
2017-07-04 03:28:56 +00:00
|
|
|
static propTypes = {
|
|
|
|
store: PropTypes.object,
|
2017-09-08 16:57:50 +00:00
|
|
|
history: PropTypes.object
|
2017-07-04 03:28:56 +00:00
|
|
|
};
|
2017-04-12 05:04:27 +00:00
|
|
|
|
2017-07-04 03:28:56 +00:00
|
|
|
render() {
|
2017-09-08 16:57:50 +00:00
|
|
|
const { store, history } = this.props;
|
2017-07-04 03:28:56 +00:00
|
|
|
return (
|
2017-09-08 16:57:50 +00:00
|
|
|
<Provider store={store}>
|
2017-07-04 03:28:56 +00:00
|
|
|
<Router history={history} key={Math.random()}>
|
2017-09-08 16:57:50 +00:00
|
|
|
<Route name="App" path="" component={App}>
|
|
|
|
<Route name="GenerateWallet" path="/" component={GenerateWallet} />
|
|
|
|
<Route
|
|
|
|
name="ViewWallet"
|
|
|
|
path="/view-wallet"
|
|
|
|
component={ViewWallet}
|
|
|
|
/>
|
|
|
|
<Route name="Help" path="/help" component={Help} />
|
|
|
|
<Route name="Swap" path="/swap" component={Swap} />
|
|
|
|
<Route
|
|
|
|
name="Send"
|
|
|
|
path="/send-transaction"
|
|
|
|
component={SendTransaction}
|
|
|
|
/>
|
|
|
|
<Route name="Contracts" path="/contracts" component={Contracts} />
|
|
|
|
<Route name="ENS" path="/ens" component={ENS} />
|
|
|
|
<Redirect from="/*" to="/" />
|
|
|
|
</Route>
|
2017-07-04 03:28:56 +00:00
|
|
|
</Router>
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
}
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|