boilerplate for third step

This commit is contained in:
Jannis R 2016-11-07 15:13:22 +01:00
parent 4c199ef716
commit 89a2917935
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5

View File

@ -26,6 +26,7 @@ const contract = '0x7B3F58965439b22ef1dA4BB78f16191d11ab80B0';
import CheckIfCertified from './CheckIfCertified'; import CheckIfCertified from './CheckIfCertified';
import GatherData from './GatherData'; import GatherData from './GatherData';
import SendRequest from './SendRequest';
export default class SMSVerification extends Component { export default class SMSVerification extends Component {
static contextTypes = { static contextTypes = {
@ -62,7 +63,7 @@ export default class SMSVerification extends Component {
title='verify your account via SMS' title='verify your account via SMS'
visible scroll visible scroll
current={ step } current={ step }
steps={ ['first step', 'second step'] } steps={ ['first step', 'second step', 'third step'] }
> >
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
@ -81,7 +82,7 @@ export default class SMSVerification extends Component {
/> />
); );
if (step === 1) { if (step === 2) {
return ( return (
<div> <div>
{ cancel } { cancel }
@ -108,8 +109,15 @@ export default class SMSVerification extends Component {
} }
renderStep () { renderStep () {
const { contract } = this.state;
if (!contract) {
return null;
}
const { step } = this.state; const { step } = this.state;
if (step === 1) { if (step === 2) {
return this.renderThirdStep();
} else if (step === 1) {
return this.renderSecondStep(); return this.renderSecondStep();
} else { } else {
return this.renderFirstStep(); return this.renderFirstStep();
@ -148,15 +156,24 @@ export default class SMSVerification extends Component {
renderSecondStep () { renderSecondStep () {
return ( return (
<GatherData <GatherData
onData={ this.onData }
onDataIsValid={ this.onDataIsValid } onDataIsValid={ this.onDataIsValid }
onDataIsInvalid={ this.onDataIsInvalid } onDataIsInvalid={ this.onDataIsInvalid }
/> />
); );
} }
renderSecondStep () { renderThirdStep () {
const { account } = this.props;
const { contract, data } = this.state;
return ( return (
<span>second step</span> <SendRequest
account={ account } contract={ contract } data={ data }
onData={ this.onData }
onSuccess={ this.onDataIsValid }
onError={ this.onDataIsInvalid }
/>
); );
} }
} }