slider-verification-dialog
v1.0.0
Published
A react component slider verification dialog
Downloads
2
Maintainers
Readme
slider-verification-dialog
usage
import React, {Component} from 'react';
import SliderVerificationDialog from 'slider-verification-dialog';
class Example extends Component {
constructor(props) {
super(props);
this.state = {
sliderVerifyVisible: false
};
}
onSliderError = (param) => {
console.log('slider error: ', param);
};
onSliderComplete = (param) => {
console.log('slider success: ', param);
this.closeSliderVerify();
};
closeSliderVerify = (type = 'hide') => {
this.setState({sliderVerifyVisible: type === 'show'});
};
render() {
const {sliderVerifyVisible} = this.state;
return (
<div className="main">
<button onClick={this.closeSliderVerify.bind(this, 'show')}>open dialog</button>
{sliderVerifyVisible &&
<SliderVerificationDialog
onClose={this.closeSliderVerify}
onError={this.onSliderError}
onComplete={this.onSliderComplete}/>}
</div>
);
}
}