James Prado b7ba8ac22d Routing Improvements (#859)
* Nest Routes

* Update routing for subtabs

* Revert 'remove subtabs component'

* Update contract routes

* Update subtabs component

* Remove typo

* Update routing to handle disabled subroutes

* add disable prop to request payment tab

* Update request payment disabled condition

* Add CaptureRouteNotFound & RouteNotFound components

* Update ENS routing

* Remove any type

* Display 404 before unlocking wallet
2018-01-22 06:24:05 -06:00

39 lines
1.3 KiB
TypeScript

import React, { Component } from 'react';
import Keystore from './components/Keystore';
import Mnemonic from './components/Mnemonic';
import WalletTypes from './components/WalletTypes';
import CryptoWarning from './components/CryptoWarning';
import TabSection from 'containers/TabSection';
import { RouteComponentProps } from 'react-router-dom';
import { Route, Switch } from 'react-router';
import { RouteNotFound } from 'components/RouteNotFound';
export enum WalletType {
Keystore = 'keystore',
Mnemonic = 'mnemonic'
}
export default class GenerateWallet extends Component<RouteComponentProps<{}>> {
public render() {
const currentPath = this.props.match.url;
return (
<React.Fragment>
<TabSection>
<section className="Tab-content">
{window.crypto ? (
<Switch>
<Route exact={true} path={currentPath} component={WalletTypes} />
<Route exact={true} path={`${currentPath}/keystore`} component={Keystore} />
<Route exact={true} path={`${currentPath}/mnemonic`} component={Mnemonic} />
<RouteNotFound />
</Switch>
) : (
<CryptoWarning />
)}
</section>
</TabSection>
</React.Fragment>
);
}
}