2017-12-28 19:54:07 +00:00
|
|
|
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';
|
2018-01-22 12:24:05 +00:00
|
|
|
import { Route, Switch } from 'react-router';
|
|
|
|
import { RouteNotFound } from 'components/RouteNotFound';
|
2017-12-28 19:54:07 +00:00
|
|
|
|
|
|
|
export enum WalletType {
|
|
|
|
Keystore = 'keystore',
|
|
|
|
Mnemonic = 'mnemonic'
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class GenerateWallet extends Component<RouteComponentProps<{}>> {
|
|
|
|
public render() {
|
2018-01-22 12:24:05 +00:00
|
|
|
const currentPath = this.props.match.url;
|
2017-12-28 19:54:07 +00:00
|
|
|
return (
|
2018-01-22 12:24:05 +00:00
|
|
|
<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>
|
2017-12-28 19:54:07 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|