2017-07-04 03:28:56 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Provider } from 'react-redux';
|
2017-09-29 02:09:01 +00:00
|
|
|
import { Router, Route } from 'react-router-dom';
|
|
|
|
// Components
|
2017-10-17 04:01:28 +00:00
|
|
|
import Contracts from 'containers/Tabs/Contracts';
|
2017-09-29 02:09:01 +00:00
|
|
|
import ENS from 'containers/Tabs/ENS';
|
|
|
|
import GenerateWallet from 'containers/Tabs/GenerateWallet';
|
|
|
|
import Help from 'containers/Tabs/Help';
|
|
|
|
import SendTransaction from 'containers/Tabs/SendTransaction';
|
|
|
|
import Swap from 'containers/Tabs/Swap';
|
|
|
|
import ViewWallet from 'containers/Tabs/ViewWallet';
|
2017-10-23 20:48:55 +00:00
|
|
|
import BroadcastTx from 'containers/Tabs/BroadcastTx';
|
2017-04-12 05:04:27 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
// TODO: fix this
|
|
|
|
interface Props {
|
|
|
|
store: any;
|
|
|
|
history: any;
|
|
|
|
}
|
2017-04-12 05:04:27 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export default class Root extends Component<Props, {}> {
|
|
|
|
public render() {
|
2017-09-29 02:09:01 +00:00
|
|
|
const { store, history } = this.props;
|
2017-09-18 06:31:52 +00:00
|
|
|
// key={Math.random()} = hack for HMR from https://github.com/webpack/webpack-dev-server/issues/395
|
2017-07-04 03:28:56 +00:00
|
|
|
return (
|
2017-09-18 06:31:52 +00:00
|
|
|
<Provider store={store} key={Math.random()}>
|
2017-07-04 03:28:56 +00:00
|
|
|
<Router history={history} key={Math.random()}>
|
2017-09-29 02:09:01 +00:00
|
|
|
<div>
|
|
|
|
<Route exact={true} path="/" component={GenerateWallet} />
|
|
|
|
<Route path="/view-wallet" component={ViewWallet} />
|
|
|
|
<Route path="/help" component={Help} />
|
|
|
|
<Route path="/swap" component={Swap} />
|
|
|
|
<Route path="/send-transaction" component={SendTransaction} />
|
2017-10-17 04:01:28 +00:00
|
|
|
<Route path="/contracts" component={Contracts} />
|
2017-09-29 02:09:01 +00:00
|
|
|
<Route path="/ens" component={ENS} />
|
2017-10-23 20:48:55 +00:00
|
|
|
<Route path="/pushTx" component={BroadcastTx} />
|
2017-09-29 02:09:01 +00:00
|
|
|
</div>
|
2017-07-04 03:28:56 +00:00
|
|
|
</Router>
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
}
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|