2021-02-04 19:15:23 +01:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Button from '../../../components/ui/button';
|
|
|
|
import MetaFoxLogo from '../../../components/ui/metafox-logo';
|
|
|
|
import { INITIALIZE_METAMETRICS_OPT_IN_ROUTE } from '../../../helpers/constants/routes';
|
2019-02-27 15:46:41 +01:00
|
|
|
|
|
|
|
export default class SelectAction extends PureComponent {
|
|
|
|
static propTypes = {
|
|
|
|
history: PropTypes.object,
|
|
|
|
isInitialized: PropTypes.bool,
|
2019-03-05 16:45:01 +01:00
|
|
|
setFirstTimeFlowType: PropTypes.func,
|
|
|
|
nextRoute: PropTypes.string,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-02-27 15:46:41 +01:00
|
|
|
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-02-27 15:46:41 +01:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
componentDidMount() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { history, isInitialized, nextRoute } = this.props;
|
2019-02-27 15:46:41 +01:00
|
|
|
|
|
|
|
if (isInitialized) {
|
2021-02-04 19:15:23 +01:00
|
|
|
history.push(nextRoute);
|
2019-02-27 15:46:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
handleCreate = () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
this.props.setFirstTimeFlowType('create');
|
|
|
|
this.props.history.push(INITIALIZE_METAMETRICS_OPT_IN_ROUTE);
|
|
|
|
};
|
2019-02-27 15:46:41 +01:00
|
|
|
|
|
|
|
handleImport = () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
this.props.setFirstTimeFlowType('import');
|
|
|
|
this.props.history.push(INITIALIZE_METAMETRICS_OPT_IN_ROUTE);
|
|
|
|
};
|
2019-02-27 15:46:41 +01:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { t } = this.context;
|
2019-02-27 15:46:41 +01:00
|
|
|
|
|
|
|
return (
|
2019-07-31 22:17:11 +02:00
|
|
|
<div className="select-action">
|
2019-07-09 19:17:58 +02:00
|
|
|
<MetaFoxLogo />
|
2019-02-27 15:46:41 +01:00
|
|
|
|
|
|
|
<div className="select-action__wrapper">
|
|
|
|
<div className="select-action__body">
|
|
|
|
<div className="select-action__body-header">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('newToMetaMask')}
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
|
|
|
<div className="select-action__select-buttons">
|
|
|
|
<div className="select-action__select-button">
|
|
|
|
<div className="select-action__button-content">
|
|
|
|
<div className="select-action__button-symbol">
|
2021-05-25 02:20:09 +02:00
|
|
|
<img src="./images/download-alt.svg" alt="" />
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
|
|
|
<div className="select-action__button-text-big">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('noAlreadyHaveSeed')}
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
2019-03-05 16:45:01 +01:00
|
|
|
<div className="select-action__button-text-small">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('importYourExisting')}
|
2019-03-05 16:45:01 +01:00
|
|
|
</div>
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
className="first-time-flow__button"
|
|
|
|
onClick={this.handleImport}
|
|
|
|
>
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('importWallet')}
|
2019-02-27 15:46:41 +01:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
<div className="select-action__select-button">
|
|
|
|
<div className="select-action__button-content">
|
|
|
|
<div className="select-action__button-symbol">
|
2021-05-25 02:20:09 +02:00
|
|
|
<img src="./images/thin-plus.svg" alt="" />
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
|
|
|
<div className="select-action__button-text-big">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('letsGoSetUp')}
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
2019-03-05 16:45:01 +01:00
|
|
|
<div className="select-action__button-text-small">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('thisWillCreate')}
|
2019-03-05 16:45:01 +01:00
|
|
|
</div>
|
2019-02-27 15:46:41 +01:00
|
|
|
</div>
|
|
|
|
<Button
|
2019-04-16 21:35:22 +02:00
|
|
|
type="primary"
|
2019-02-27 15:46:41 +01:00
|
|
|
className="first-time-flow__button"
|
|
|
|
onClick={this.handleCreate}
|
|
|
|
>
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('createAWallet')}
|
2019-02-27 15:46:41 +01:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-31 22:17:11 +02:00
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2019-02-27 15:46:41 +01:00
|
|
|
}
|
|
|
|
}
|