// Copyright 2015-2018 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: BSD-3-Clause import React, { Component } from 'react'; import { AccountCard, Card, Form as FetherForm } from 'fether-ui'; import { inject, observer } from 'mobx-react'; import AccountImportOptions from '../AccountImportOptions'; @inject('createAccountStore') @observer class AccountRewritePhrase extends Component { state = { isLoading: false, value: '' }; handleChange = ({ target: { value } }) => { this.setState({ value }); }; handleSubmit = async () => { const { history, location: { pathname }, createAccountStore: { isImport, setPhrase } } = this.props; const currentStep = pathname.slice(-1); const { value } = this.state; // If we're importing, derive address from recovery phrase when we submit if (isImport) { this.setState({ isLoading: true }); await setPhrase(value); } history.push(`/accounts/new/${+currentStep + 1}`); }; render () { const { createAccountStore: { address, isImport, name }, history, location: { pathname } } = this.props; const { value } = this.state; const currentStep = pathname.slice(-1); const body = [
]; return isImport ? (