Commit 55620cd7 authored by Amaury Martiny's avatar Amaury Martiny
Browse files

Add back buttons in account creation

parent e0bf89c3
Pipeline #44254 canceled with stages
......@@ -14,6 +14,7 @@ class AccountCopyPhrase extends Component {
render () {
const {
createAccountStore: { address, name, phrase },
history,
location: { pathname }
} = this.props;
const currentStep = pathname.slice(-1);
......@@ -43,7 +44,12 @@ class AccountCopyPhrase extends Component {
</ul>
</div>
</div>
<nav className='form-nav'>
<nav className='form-nav -space-around'>
{currentStep > 1 && (
<button className='button -cancel' onClick={history.goBack}>
Back
</button>
)}
<Link to={`/accounts/new/${+currentStep + 1}`}>
<button className='button'>Next</button>
</Link>
......
......@@ -69,6 +69,7 @@ class AccountName extends Component {
renderDrawer = () => {
const {
createAccountStore: { name },
history,
location: { pathname }
} = this.props;
const currentStep = pathname.slice(-1);
......@@ -85,7 +86,12 @@ class AccountName extends Component {
type='text'
value={name}
/>
<nav className='form-nav'>
<nav className='form-nav -space-around'>
{currentStep > 1 && (
<button className='button -cancel' onClick={history.goBack}>
Back
</button>
)}
{name ? (
<Link to={`/accounts/new/${+currentStep + 1}`}>
<button className='button'>Next</button>
......
......@@ -38,9 +38,12 @@ class AccountPassword extends Component {
render () {
const {
createAccountStore: { address, name }
createAccountStore: { address, name },
history,
location: { pathname }
} = this.props;
const { confirm, password } = this.state;
const currentStep = pathname.slice(-1);
return (
<AccountCard
......@@ -68,7 +71,12 @@ class AccountPassword extends Component {
value={confirm}
/>
<nav className='form-nav'>
<nav className='form-nav -space-around'>
{currentStep > 1 && (
<button className='button -cancel' onClick={history.goBack}>
Back
</button>
)}
<button
className='button'
disabled={!password || confirm !== password}
......
......@@ -54,9 +54,12 @@ class AccountRewritePhrase extends Component {
render () {
const {
createAccountStore: { address, isImport, name }
createAccountStore: { address, isImport, name },
history,
location: { pathname }
} = this.props;
const { value } = this.state;
const currentStep = pathname.slice(-1);
return (
<AccountCard
......@@ -81,7 +84,14 @@ class AccountRewritePhrase extends Component {
label='Recovery phrase'
/>
<nav className='form-nav'>{this.renderButton()}</nav>
<nav className='form-nav -space-around'>
{currentStep > 1 && (
<button className='button -cancel' onClick={history.goBack}>
Back
</button>
)}
{this.renderButton()}
</nav>
</div>
]}
/>
......
......@@ -6,4 +6,8 @@
&.-binary {
justify-content: space-between;
}
&.-space-around {
justify-content: space-around;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment