mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-23 09:30:38 +00:00
6513acd03d
* Initial work at splitting out generate into two flows. * Finish mnemonic flow. * Convert keystore to state-based component. Remove all redux generate stuff. Remove generate help section. Fix styles. * Add back button, switch to routing instead of state for generate pages. * PR feedback. * Alertify warning at generate. Linkify alternatives. Fix some alert link styles.
38 lines
1.0 KiB
TypeScript
38 lines
1.0 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';
|
|
|
|
export enum WalletType {
|
|
Keystore = 'keystore',
|
|
Mnemonic = 'mnemonic'
|
|
}
|
|
|
|
export default class GenerateWallet extends Component<RouteComponentProps<{}>> {
|
|
public render() {
|
|
const walletType = this.props.location.pathname.split('/')[2];
|
|
let content;
|
|
|
|
if (window.crypto) {
|
|
if (walletType === WalletType.Mnemonic) {
|
|
content = <Mnemonic />;
|
|
} else if (walletType === WalletType.Keystore) {
|
|
content = <Keystore />;
|
|
} else {
|
|
content = <WalletTypes />;
|
|
}
|
|
} else {
|
|
content = <CryptoWarning />;
|
|
}
|
|
|
|
return (
|
|
<TabSection>
|
|
<section className="Tab-content">{content}</section>
|
|
</TabSection>
|
|
);
|
|
}
|
|
}
|