Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: MIT
import { inject, observer } from 'mobx-react';
import { Link } from 'react-router-dom';
import CreateAccountHeader from '../CreateAccountHeader';
class AccountName extends Component {
const { createAccountStore } = this.props;
// Generate a new public address if there's none yet
if (!createAccountStore.address) {
createAccountStore.generateNewAccount();
}
this.props.createAccountStore.setName(value);
createAccountStore: { address, generateNewAccount, isImport, name },
location: { pathname }
const currentStep = pathname.slice(-1);
<div className='box -pull-up text -right'>
<button
onClick={generateNewAccount}
className='button -tiny -reload'
>
Regenerate address
</button>
<div className='text'>
<p>Please give this account a name:</p>
</div>
<FormField
label='Name'
onChange={this.handleChangeName}
required
type='text'
value={name}
/>
{name ? (
<Link to={`/accounts/new/${+currentStep + 1}`}>
<button className='button'>Next</button>
</Link>
) : (
<button className='button' disabled>
Next
</button>
)}