58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
/**
|
|
* Project iLinkCity
|
|
* File index
|
|
* Path components/QRCodeScanner
|
|
* Created by BRICE ZELE
|
|
* Date: 03/08/2021
|
|
*/
|
|
import React, {Component} from 'react';
|
|
|
|
import {
|
|
AppRegistry,
|
|
StyleSheet,
|
|
Text,
|
|
TouchableOpacity,
|
|
Linking
|
|
} from 'react-native';
|
|
|
|
import QRCodeScanner from 'react-native-qrcode-scanner';
|
|
import {RNCamera} from 'react-native-camera';
|
|
import I18n from 'react-native-i18n';
|
|
|
|
export class QRCodeScreen extends Component {
|
|
|
|
render() {
|
|
return (
|
|
<QRCodeScanner
|
|
onRead={this.props.onSuccess}
|
|
flashMode={RNCamera.Constants.FlashMode.torch}
|
|
topContent={
|
|
<Text style={styles.centerText}>
|
|
{I18n.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')}
|
|
</Text>
|
|
}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
centerText: {
|
|
flex: 1,
|
|
fontSize: 18,
|
|
padding: 32,
|
|
color: '#777'
|
|
},
|
|
textBold: {
|
|
fontWeight: '500',
|
|
color: '#000'
|
|
},
|
|
buttonText: {
|
|
fontSize: 21,
|
|
color: 'rgb(0,122,255)'
|
|
},
|
|
buttonTouchable: {
|
|
padding: 16
|
|
}
|
|
});
|