0.1.7 • Published 6 years ago
graycor-signature v0.1.7
graycor-signature
This is a signature modal for use in Graycor Applications
To get started: yarn add graycor-signature
in your Expo project and import it with
import GraycorSignature from 'graycor-signature';
Props
Property | Type | Default | Description |
---|---|---|---|
visible | bool | false | show/hide Signature Modal |
onCloseSignature | func | null | Function the modal calls to close |
onSignatureReceived | func | null | Function the modal calls when signature is returned |
Example
import React, { Component } from 'react';
import { View, Button } from 'react-native';
import GraycorSignature from 'graycor-signature';
export default class TestSignature extends Component {
constructor(props) {
super(props);
this.state = {
isVisible: false,
signatureURI: null,
}
}
toggleSignature = () => this.setState({isVisible: !this.state.isVisible});
signatureReceived = uri => {
this.setState({
signatureURI: uri
}, () => this.closeSignature());
}
render() {
return (
<View>
<GraycorSignature
visible={this.state.isVisible}
onCloseSignature={this.toggleSignature}
onSignatureReceived={this.signatureReceived}
/>
<Button onPress={this.toggleSignature}>
<Text>Show Signature</Text>
</Button>
</View>
)
}
};