sms verification: collect data
This commit is contained in:
parent
14da2d2805
commit
4c199ef716
@ -25,7 +25,8 @@ import styles from './gatherData.css';
|
|||||||
export default class GatherData extends Component {
|
export default class GatherData extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onDataIsValid: PropTypes.func.isRequired,
|
onDataIsValid: PropTypes.func.isRequired,
|
||||||
onDataIsInvalid: PropTypes.func.isRequired
|
onDataIsInvalid: PropTypes.func.isRequired,
|
||||||
|
onData: PropTypes.func.isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -56,6 +57,7 @@ export default class GatherData extends Component {
|
|||||||
|
|
||||||
numberOnSubmit = (value) => {
|
numberOnSubmit = (value) => {
|
||||||
this.numberOnChange(null, value);
|
this.numberOnChange(null, value);
|
||||||
|
this.props.onData({ number: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
numberOnChange = (_, value) => {
|
numberOnChange = (_, value) => {
|
||||||
@ -68,6 +70,7 @@ export default class GatherData extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
consentGiven: !!consentGiven
|
consentGiven: !!consentGiven
|
||||||
}, this.onChange);
|
}, this.onChange);
|
||||||
|
this.props.onData({ consent: consentGiven });
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange = () => {
|
onChange = () => {
|
||||||
|
@ -42,8 +42,7 @@ export default class SMSVerification extends Component {
|
|||||||
contract: null,
|
contract: null,
|
||||||
step: 0,
|
step: 0,
|
||||||
stepIsValid: false,
|
stepIsValid: false,
|
||||||
number: null,
|
data: {}
|
||||||
numberError: null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
@ -123,6 +122,11 @@ export default class SMSVerification extends Component {
|
|||||||
onDataIsInvalid = () => {
|
onDataIsInvalid = () => {
|
||||||
this.setState({ stepIsValid: false });
|
this.setState({ stepIsValid: false });
|
||||||
}
|
}
|
||||||
|
onData = (data) => {
|
||||||
|
this.setState({
|
||||||
|
data: Object.assign({}, this.state.data, data)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
next = () => {
|
next = () => {
|
||||||
this.setState({ step: this.state.step + 1, stepIsValid: false });
|
this.setState({ step: this.state.step + 1, stepIsValid: false });
|
||||||
|
Loading…
Reference in New Issue
Block a user