remove Prepare step

The modal got really crowded and the preparation step had
only been shown for fractions of a second anyways. The
"loading" message is now part of the next step.
This commit is contained in:
Jannis R 2016-12-08 12:11:17 +01:00
parent dfc445b6d6
commit 5418c56b01
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5

View File

@ -53,12 +53,11 @@ export default class Verification extends Component {
} }
static phases = { // mapping (store steps -> steps) static phases = { // mapping (store steps -> steps)
[LOADING]: 1, [LOADING]: 1, [QUERY_DATA]: 1,
[QUERY_DATA]: 2, [POSTING_REQUEST]: 2, [POSTED_REQUEST]: 2, [REQUESTING_CODE]: 2,
[POSTING_REQUEST]: 3, [POSTED_REQUEST]: 3, [REQUESTING_CODE]: 3, [QUERY_CODE]: 3,
[QUERY_CODE]: 4, [POSTING_CONFIRMATION]: 4, [POSTED_CONFIRMATION]: 4,
[POSTING_CONFIRMATION]: 5, [POSTED_CONFIRMATION]: 5, [DONE]: 5
[DONE]: 6
} }
state = { state = {
@ -81,8 +80,8 @@ export default class Verification extends Component {
title='verify your account' title='verify your account'
visible visible
current={ phase } current={ phase }
steps={ ['Method', 'Prepare', 'Enter Data', 'Request', 'Enter Code', 'Confirm', 'Done!'] } steps={ ['Method', 'Enter Data', 'Request', 'Enter Code', 'Confirm', 'Done!'] }
waiting={ error ? [] : [ 1, 3, 5 ] } waiting={ error ? [] : [ 2, 4 ] }
> >
{ this.renderStep(phase, error) } { this.renderStep(phase, error) }
</Modal> </Modal>
@ -103,7 +102,7 @@ export default class Verification extends Component {
return (<div>{ cancel }</div>); return (<div>{ cancel }</div>);
} }
if (phase === 6) { if (phase === 5) {
return ( return (
<div> <div>
{ cancel } { cancel }
@ -126,16 +125,16 @@ export default class Verification extends Component {
onSelectMethod(method); onSelectMethod(method);
}; };
break; break;
case 2: case 1:
action = store.sendRequest; action = store.sendRequest;
break; break;
case 3: case 2:
action = store.queryCode; action = store.queryCode;
break; break;
case 4: case 3:
action = store.sendConfirmation; action = store.sendConfirmation;
break; break;
case 5: case 4:
action = store.done; action = store.done;
break; break;
} }
@ -180,11 +179,10 @@ export default class Verification extends Component {
switch (phase) { switch (phase) {
case 1: case 1:
return ( if (step === LOADING) {
<p>Loading Verification.</p> return (<p>Loading verification data.</p>);
); }
case 2:
const { setConsentGiven } = this.props.store; const { setConsentGiven } = this.props.store;
const fields = []; const fields = [];
@ -214,12 +212,12 @@ export default class Verification extends Component {
/> />
); );
case 3: case 2:
return ( return (
<SendRequest step={ step } tx={ requestTx } /> <SendRequest step={ step } tx={ requestTx } />
); );
case 4: case 3:
let receiver, hint; let receiver, hint;
if (method === 'sms') { if (method === 'sms') {
receiver = this.props.store.number; receiver = this.props.store.number;
@ -237,12 +235,12 @@ export default class Verification extends Component {
/> />
); );
case 5: case 4:
return ( return (
<SendConfirmation step={ step } tx={ confirmationTx } /> <SendConfirmation step={ step } tx={ confirmationTx } />
); );
case 6: case 5:
return ( return (
<Done /> <Done />
); );