-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
49 lines (40 loc) · 1.1 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import PropTypes from 'prop-types';
import React from 'react';
import {requireNativeComponent} from 'react-native';
class MrzScanner extends React.Component {
constructor(props) {
super(props);
this._onScanSuccess = this._onScanSuccess.bind(this);
}
_onPermissionResult = (event) => {
if (!this.props.onPermissionResult) {
return;
}
// process raw event...
this.props.onPermissionResult(event.nativeEvent);
}
_onScanSuccess = (event) => {
if (!this.props.onScanSuccess) {
return;
}
// process raw event...
this.props.onScanSuccess(event.nativeEvent);
}
render() {
return <MRZ
{...this.props}
//onPermissionResult={this._onPermissionResult}
onScanSuccess={this._onScanSuccess}
/>;
}
}
MrzScanner.propTypes = {
/**
* A Boolean value that determines whether the user may use pinch
* gestures to zoom in and out of the map.
*/
onPermissionResult: PropTypes.func,
onScanSuccess: PropTypes.func,
};
var MRZ = requireNativeComponent('MrzScanner', MrzScanner);
module.exports = MrzScanner;