@test-web/react-native-sdk 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build/.transforms/246c075ea944392e66db7aa639265547/results.bin +1 -0
- package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/yourcompany/sdk/BuildConfig.dex +0 -0
- package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/yourcompany/sdk/YourSDKModule.dex +0 -0
- package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/yourcompany/sdk/YourSDKPackage.dex +0 -0
- package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/952af5a0e7b5b2ac3d48ad66eccefd1f/results.bin +1 -0
- package/android/build/.transforms/952af5a0e7b5b2ac3d48ad66eccefd1f/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/yourcompany/sdk/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +34 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/yourcompany/sdk/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/yourcompany/sdk/YourSDKModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/yourcompany/sdk/YourSDKPackage.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +56 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +34 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/yourcompany/sdk/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/yourcompany/sdk/YourSDKModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/yourcompany/sdk/YourSDKPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +61 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/package.json +1 -1
- package/src/apis/captureBarcode.ts +37 -0
- package/src/apis/captureMRZ.ts +39 -0
- package/src/apis/checkLiveness.ts +48 -0
- package/src/apis/index.ts +26 -75
- package/src/components/common/Footer.tsx +9 -12
- package/src/components/common/Header.tsx +8 -11
- package/src/context/FailedCountContext.tsx +35 -0
- package/src/context/IDMConfigurationContext.tsx +12 -2
- package/src/index.tsx +40 -28
- package/src/screens/BackDocumentAdvice.tsx +13 -18
- package/src/screens/BarcodeAdvice.tsx +39 -19
- package/src/screens/BarcodeCapture.tsx +127 -158
- package/src/screens/DocumentCaptureBack.tsx +145 -102
- package/src/screens/DocumentCaptureFront.tsx +146 -113
- package/src/screens/FrontDocumentAdvice.tsx +13 -18
- package/src/screens/LocationPermission.tsx +124 -17
- package/src/screens/MrzAdvice.tsx +27 -13
- package/src/screens/MrzCapture.tsx +233 -206
- package/src/screens/SelectDocuments.tsx +57 -66
- package/src/screens/SelfieCapture.tsx +135 -103
- package/src/screens/ThankYou.tsx +25 -31
- package/src/screens/VerifyIdentity.tsx +1 -0
- package/src/styles/BarcodeAdviceStyles.ts +6 -6
- package/src/styles/DocumentCaptureBackStyle.ts +70 -0
- package/src/styles/DocumentCaptureFrontStyle.ts +70 -0
- package/src/styles/FooterStyles.ts +10 -1
- package/src/styles/ScannerStyles.ts +46 -9
- package/src/styles/ThankYouStyles.ts +8 -11
- package/src/utils/MRZ_README.md +111 -0
- package/src/utils/imagesHelper.ts +264 -0
- package/src/utils/metadata_new.json +11373 -1
- package/src/utils/mrzExamples.ts +127 -0
- package/src/utils/mrzParser.ts +303 -0
- package/src/utils/mrzUtils.ts +70 -0
|
@@ -1,148 +1,180 @@
|
|
|
1
|
-
import React, { useState,
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { useNavigation } from '@react-navigation/native';
|
|
3
|
-
import { TouchableOpacity, View, StyleSheet,
|
|
3
|
+
import { TouchableOpacity, View, StyleSheet, Image, ScrollView, Text } from 'react-native';
|
|
4
|
+
import { Camera, useCameraDevice, useCameraPermission } from 'react-native-vision-camera';
|
|
5
|
+
import ImageResizer from 'react-native-image-resizer';
|
|
4
6
|
import getStyles from '../styles/SelfieCaptureStyles';
|
|
5
7
|
import { useTheme } from '../context/ThemeContext';
|
|
6
8
|
import { useOrientation } from '../hooks/useOrientation';
|
|
7
9
|
import { useIDM } from '../context/IDMConfigurationContext';
|
|
8
10
|
import Loader from '../components/common/Loader';
|
|
9
|
-
import {
|
|
11
|
+
import { checkLiveness } from '../apis';
|
|
12
|
+
import Button from '../components/ui/Button';
|
|
13
|
+
import ThemedText from '../components/ui/ThemedText';
|
|
14
|
+
import getPermissionStyles from '../styles/PermissionStyle';
|
|
15
|
+
import Header from '../components/common/Header';
|
|
16
|
+
import { useFailedCount } from '../context/FailedCountContext';
|
|
10
17
|
|
|
11
18
|
export default function SelfieCapture() {
|
|
12
19
|
const { theme } = useTheme();
|
|
13
|
-
const { idmConf
|
|
20
|
+
const { idmConf } = useIDM();
|
|
14
21
|
const orientation = useOrientation();
|
|
15
22
|
const styles = getStyles(theme, orientation);
|
|
23
|
+
const permissionStyles = getPermissionStyles(theme, orientation);
|
|
16
24
|
const navigation = useNavigation();
|
|
25
|
+
const { hasPermission, requestPermission } = useCameraPermission();
|
|
26
|
+
const device = useCameraDevice('front');
|
|
27
|
+
const cameraRef = useRef<Camera>(null);
|
|
17
28
|
const [loading, setLoading] = useState(false);
|
|
18
|
-
const
|
|
19
|
-
const [device, setDevice] = useState<any>(null);
|
|
20
|
-
const cameraRef = useRef<any>(null);
|
|
29
|
+
const { failedCount, setFailedCount } = useFailedCount();
|
|
21
30
|
|
|
22
|
-
// Initialize camera
|
|
23
31
|
useEffect(() => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
setHasPermission(true);
|
|
39
|
-
|
|
40
|
-
// Get front camera for selfie
|
|
41
|
-
const frontDevice = useCameraDevice('front');
|
|
42
|
-
if (!frontDevice) {
|
|
43
|
-
navigation.navigate('NoCameraFound' as never);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
32
|
+
if (device == null) {
|
|
33
|
+
navigation.navigate('NoCameraFound' as never);
|
|
34
|
+
}
|
|
35
|
+
}, [device, navigation]);
|
|
36
|
+
|
|
37
|
+
// Show permission request screen if camera permission is not granted
|
|
38
|
+
if (!hasPermission) {
|
|
39
|
+
return (
|
|
40
|
+
<ScrollView contentContainerStyle={permissionStyles.container}>
|
|
41
|
+
<Header />
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
<ThemedText style={permissionStyles.maintitle} type="title">
|
|
44
|
+
Camera Access Required
|
|
45
|
+
</ThemedText>
|
|
46
|
+
|
|
47
|
+
<View style={{ padding: 20 }}>
|
|
48
|
+
<Text style={{ color: theme.colors.text, textAlign: 'center', marginBottom: 20 }}>
|
|
49
|
+
This app needs access to your camera to take selfies. Please grant camera permission.
|
|
50
|
+
</Text>
|
|
51
|
+
</View>
|
|
52
|
+
|
|
53
|
+
<Button
|
|
54
|
+
title="Grant Permission"
|
|
55
|
+
style={permissionStyles.buttonplace}
|
|
56
|
+
textStyle={permissionStyles.button}
|
|
57
|
+
onPress={async () => {
|
|
58
|
+
const granted = await requestPermission();
|
|
59
|
+
if (!granted) {
|
|
60
|
+
// Permission denied, stay on this screen
|
|
61
|
+
console.log('Camera permission denied');
|
|
62
|
+
}
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
</ScrollView>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
53
68
|
|
|
54
|
-
|
|
55
|
-
}, [navigation]);
|
|
69
|
+
if (!device) return null;
|
|
56
70
|
|
|
57
|
-
|
|
58
|
-
if (!cameraRef.current) {
|
|
59
|
-
// Fallback for testing without camera
|
|
60
|
-
Alert.alert('Camera Not Available', 'Camera is not available. Proceeding to next step.');
|
|
61
|
-
navigation.navigate('SelectDocuments' as never);
|
|
71
|
+
async function takePhoto() {
|
|
72
|
+
if (!cameraRef.current || loading) {
|
|
62
73
|
return;
|
|
63
74
|
}
|
|
64
75
|
|
|
65
76
|
try {
|
|
66
77
|
setLoading(true);
|
|
67
|
-
|
|
68
|
-
const photo = await cameraRef.current.takePhoto();
|
|
69
78
|
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
const photo = await cameraRef.current.takePhoto({
|
|
80
|
+
quality: '100',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (!photo.path) {
|
|
84
|
+
console.error('No photo path available');
|
|
72
85
|
setLoading(false);
|
|
73
86
|
return;
|
|
74
87
|
}
|
|
75
88
|
|
|
76
|
-
|
|
77
|
-
const base64Image = await processImageToBase64(photo.path);
|
|
78
|
-
|
|
79
|
-
// TODO: Integrate with liveness detection API
|
|
80
|
-
// For now, just store the selfie and proceed
|
|
81
|
-
setIDMConf({
|
|
82
|
-
...idmConf,
|
|
83
|
-
userDetails: {
|
|
84
|
-
...idmConf.userDetails,
|
|
85
|
-
selfieImage: base64Image,
|
|
86
|
-
},
|
|
87
|
-
});
|
|
89
|
+
let photoData;
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
try {
|
|
92
|
+
// ✅ Force resize to exactly 480 × 640
|
|
93
|
+
const resizedImage = await ImageResizer.createResizedImage(
|
|
94
|
+
photo.path,
|
|
95
|
+
480,
|
|
96
|
+
640,
|
|
97
|
+
'JPEG',
|
|
98
|
+
80,
|
|
99
|
+
270,
|
|
100
|
+
undefined,
|
|
101
|
+
undefined,
|
|
102
|
+
{ mode: 'stretch', onlyScaleDown: true }
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
// handle uri/path safely
|
|
106
|
+
const fileUri = resizedImage.uri || `file://${resizedImage.path}`;
|
|
107
|
+
|
|
108
|
+
photoData = {
|
|
109
|
+
latitude: String(idmConf.userDetails?.location?.coords.latitude || ''),
|
|
110
|
+
longitude: String(idmConf.userDetails?.location?.coords.longitude || ''),
|
|
111
|
+
token: String(idmConf.verificationCode || ''),
|
|
112
|
+
file: {
|
|
113
|
+
uri: fileUri,
|
|
114
|
+
type: 'image/jpeg',
|
|
115
|
+
name: 'selfie.jpg',
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
} catch (resizeError: any) {
|
|
119
|
+
console.warn('Image resizing failed, using original image:', resizeError.message);
|
|
120
|
+
photoData = {
|
|
121
|
+
latitude: String(idmConf.userDetails?.location?.coords.latitude || ''),
|
|
122
|
+
longitude: String(idmConf.userDetails?.location?.coords.longitude || ''),
|
|
123
|
+
token: String(idmConf.verificationCode || ''),
|
|
124
|
+
file: {
|
|
125
|
+
uri: `file://${photo.path}`,
|
|
126
|
+
type: 'image/jpeg',
|
|
127
|
+
name: 'selfie.jpg',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const livenessResult = await checkLiveness(idmConf, photoData);
|
|
133
|
+
|
|
134
|
+
if (livenessResult.status) {
|
|
135
|
+
// Failed liveness check
|
|
136
|
+
setFailedCount((prev) => prev + 1);
|
|
137
|
+
if (failedCount >= 4) {
|
|
138
|
+
// After 5 failed attempts (0-4), reset and proceed to next page
|
|
139
|
+
setFailedCount(0);
|
|
140
|
+
navigation.navigate('SelectDocuments' as never);
|
|
141
|
+
} else {
|
|
142
|
+
navigation.navigate('RetakeSelfie' as never, {
|
|
143
|
+
errorMessage: livenessResult.errorMessage,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
// Success - reset failed count and proceed
|
|
148
|
+
setFailedCount(0);
|
|
149
|
+
navigation.navigate('SelectDocuments' as never);
|
|
150
|
+
}
|
|
91
151
|
} catch (error: any) {
|
|
92
|
-
console.error('
|
|
93
|
-
Alert.alert('Error', 'Failed to capture selfie');
|
|
152
|
+
console.error('Failed to take photo, resize image, or perform liveness check:', error.message);
|
|
94
153
|
} finally {
|
|
95
154
|
setLoading(false);
|
|
96
155
|
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Render camera if available
|
|
100
|
-
const renderCamera = () => {
|
|
101
|
-
try {
|
|
102
|
-
const { Camera } = require('react-native-vision-camera');
|
|
103
|
-
|
|
104
|
-
if (hasPermission && device) {
|
|
105
|
-
return (
|
|
106
|
-
<Camera
|
|
107
|
-
ref={cameraRef}
|
|
108
|
-
style={StyleSheet.absoluteFill}
|
|
109
|
-
device={device}
|
|
110
|
-
isActive={true}
|
|
111
|
-
photo={true}
|
|
112
|
-
/>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.warn('Camera render failed:', error);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Fallback placeholder
|
|
120
|
-
return (
|
|
121
|
-
<View style={[StyleSheet.absoluteFill, { backgroundColor: '#000' }]}>
|
|
122
|
-
<Text style={[styles.text, { color: '#fff', marginTop: 100 }]}>
|
|
123
|
-
Camera Preview
|
|
124
|
-
</Text>
|
|
125
|
-
</View>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
156
|
+
}
|
|
128
157
|
|
|
129
158
|
return (
|
|
130
159
|
<View style={styles.container}>
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
160
|
+
{device && (
|
|
161
|
+
<Camera
|
|
162
|
+
ref={cameraRef}
|
|
163
|
+
style={StyleSheet.absoluteFill}
|
|
164
|
+
device={device}
|
|
165
|
+
isActive={true}
|
|
166
|
+
photo={true}
|
|
167
|
+
/>
|
|
168
|
+
)}
|
|
169
|
+
<Image
|
|
135
170
|
source={require('../../assets/images/photo-overlay.png')}
|
|
136
171
|
style={styles.cameraoverlay}
|
|
137
|
-
|
|
138
|
-
/> */}
|
|
139
|
-
|
|
140
|
-
{/* Capture button */}
|
|
172
|
+
/>
|
|
141
173
|
<View style={styles.buttonplace}>
|
|
142
174
|
<TouchableOpacity
|
|
143
175
|
style={styles.captureButton}
|
|
144
176
|
onPress={takePhoto}
|
|
145
|
-
|
|
177
|
+
disabled={loading}
|
|
146
178
|
/>
|
|
147
179
|
</View>
|
|
148
180
|
|
package/src/screens/ThankYou.tsx
CHANGED
|
@@ -1,56 +1,50 @@
|
|
|
1
|
-
import React, { useEffect
|
|
2
|
-
import { View } from 'react-native';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { View, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import ThemedText from '../components/ui/ThemedText';
|
|
4
4
|
import getStyles from '../styles/ThankYouStyles';
|
|
5
5
|
import { useTheme } from '../context/ThemeContext';
|
|
6
6
|
import { useOrientation } from '../hooks/useOrientation';
|
|
7
7
|
import { useIDM } from '../context/IDMConfigurationContext';
|
|
8
|
-
import Loader from '../components/common/Loader';
|
|
9
8
|
import { completeVerification } from '../apis';
|
|
10
9
|
|
|
11
10
|
export default function ThankYou() {
|
|
12
11
|
const { theme } = useTheme();
|
|
13
|
-
const { idmConf } = useIDM();
|
|
14
12
|
const orientation = useOrientation();
|
|
13
|
+
const { idmConf } = useIDM();
|
|
15
14
|
const styles = getStyles(theme, orientation);
|
|
16
|
-
const [loading, setLoading] = useState(false);
|
|
17
|
-
const [completed, setCompleted] = useState(false);
|
|
18
15
|
|
|
19
|
-
// Call complete verification API
|
|
20
16
|
useEffect(() => {
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
async function verify() {
|
|
18
|
+
if (idmConf?.verificationCode && idmConf?.accessToken) {
|
|
19
|
+
try {
|
|
20
|
+
const result = await completeVerification(idmConf);
|
|
21
|
+
console.log('Verification completed successfully:', result);
|
|
22
|
+
} catch (error: any) {
|
|
23
|
+
// Silently handle errors - verification may already be completed
|
|
24
|
+
// 400 error typically means verification was already processed or not ready
|
|
25
|
+
if (error.message?.includes('400')) {
|
|
26
|
+
console.log('Verification not ready or already completed (400 error)');
|
|
27
|
+
} else {
|
|
28
|
+
console.error('Error completing verification:', error.message);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
34
31
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return () => clearTimeout(timer);
|
|
43
|
-
}, [idmConf, completed]);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Only call verify if we have the required credentials
|
|
35
|
+
if (idmConf?.verificationCode && idmConf?.accessToken) {
|
|
36
|
+
verify();
|
|
37
|
+
}
|
|
38
|
+
}, [idmConf?.verificationCode, idmConf?.accessToken]);
|
|
44
39
|
|
|
45
40
|
return (
|
|
46
|
-
<View style={styles.container}>
|
|
41
|
+
<View style={styles.container as StyleProp<ViewStyle>}>
|
|
47
42
|
<ThemedText style={styles.maintitle} type="title">
|
|
48
43
|
Thank You!
|
|
49
44
|
</ThemedText>
|
|
50
45
|
<ThemedText style={styles.subtitle} type="title">
|
|
51
46
|
Your information{'\n'}has been uploaded
|
|
52
47
|
</ThemedText>
|
|
53
|
-
{loading && <Loader />}
|
|
54
48
|
</View>
|
|
55
49
|
);
|
|
56
50
|
}
|
|
@@ -47,6 +47,7 @@ export default function VerifyIdentity() {
|
|
|
47
47
|
title="Let's Verify"
|
|
48
48
|
style={styles.buttonplace}
|
|
49
49
|
textStyle={styles.button}
|
|
50
|
+
// onPress={() => navigation.navigate('SelfieAdvice' as never)}
|
|
50
51
|
onPress={() => navigation.navigate('SelfieAdvice' as never)}
|
|
51
52
|
/>
|
|
52
53
|
</ScrollView>
|
|
@@ -16,14 +16,14 @@ export default (theme: Theme, orientation: Orientation) => {
|
|
|
16
16
|
maintitle: {
|
|
17
17
|
textAlign: 'center',
|
|
18
18
|
fontWeight: '300',
|
|
19
|
-
marginBottom:
|
|
19
|
+
marginBottom: 0,
|
|
20
20
|
color: theme.colors.text,
|
|
21
21
|
},
|
|
22
22
|
idcard: {
|
|
23
|
-
marginTop: isPortrait ?
|
|
23
|
+
marginTop: isPortrait ? 30 : 10,
|
|
24
24
|
marginBottom: 0,
|
|
25
|
-
width: isPortrait ? 300 :
|
|
26
|
-
height: isPortrait ?
|
|
25
|
+
width: isPortrait ? 300 : 150,
|
|
26
|
+
height: isPortrait ? 280 : 90,
|
|
27
27
|
},
|
|
28
28
|
buttonplace: {
|
|
29
29
|
position: 'absolute',
|
|
@@ -36,8 +36,8 @@ export default (theme: Theme, orientation: Orientation) => {
|
|
|
36
36
|
color: theme.colors.buttonText,
|
|
37
37
|
fontSize: 16,
|
|
38
38
|
fontWeight: 'bold',
|
|
39
|
-
paddingVertical:
|
|
40
|
-
paddingHorizontal:
|
|
39
|
+
paddingVertical: 3,
|
|
40
|
+
paddingHorizontal: 30,
|
|
41
41
|
borderRadius: 5,
|
|
42
42
|
textAlign: 'center',
|
|
43
43
|
},
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Theme } from '../types/idmerit-sdk';
|
|
3
|
+
import { Orientation } from '../hooks/useOrientation';
|
|
4
|
+
|
|
5
|
+
export default (theme: Theme, orientation: Orientation) => {
|
|
6
|
+
const isPortrait = orientation === 'portrait';
|
|
7
|
+
|
|
8
|
+
return StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
flex: 1,
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
backgroundColor: theme.colors.background,
|
|
13
|
+
position: 'relative',
|
|
14
|
+
},
|
|
15
|
+
topLabel: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: isPortrait ? 60 : 20,
|
|
18
|
+
fontSize: 18,
|
|
19
|
+
width: '100%',
|
|
20
|
+
textAlign: 'center',
|
|
21
|
+
zIndex: 5,
|
|
22
|
+
color: '#fff',
|
|
23
|
+
},
|
|
24
|
+
bottomLabel: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
bottom: isPortrait ? 140 : 20,
|
|
27
|
+
fontSize: 16,
|
|
28
|
+
width: '100%',
|
|
29
|
+
textAlign: 'center',
|
|
30
|
+
zIndex: 5,
|
|
31
|
+
color: '#fff',
|
|
32
|
+
},
|
|
33
|
+
camera: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
},
|
|
36
|
+
button: {
|
|
37
|
+
width: 100,
|
|
38
|
+
height: 50,
|
|
39
|
+
},
|
|
40
|
+
cardoverlay: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
width: '100%',
|
|
43
|
+
height: '100%',
|
|
44
|
+
top: 0,
|
|
45
|
+
bottom: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
},
|
|
49
|
+
buttonplace: {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
bottom: isPortrait ? 50 : 20,
|
|
52
|
+
left: '50%',
|
|
53
|
+
marginLeft: -35,
|
|
54
|
+
},
|
|
55
|
+
captureButton: {
|
|
56
|
+
width: 70,
|
|
57
|
+
height: 70,
|
|
58
|
+
backgroundColor: 'white',
|
|
59
|
+
borderRadius: 35,
|
|
60
|
+
borderWidth: 4,
|
|
61
|
+
borderColor: '#ccc',
|
|
62
|
+
},
|
|
63
|
+
text: {
|
|
64
|
+
color: '#fff',
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
textAlign: 'center',
|
|
67
|
+
marginBottom: 20,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Theme } from '../types';
|
|
3
|
+
import { Orientation } from '../hooks/useOrientation';
|
|
4
|
+
|
|
5
|
+
export default (theme: Theme, orientation: Orientation) => {
|
|
6
|
+
const isPortrait = orientation === 'portrait';
|
|
7
|
+
|
|
8
|
+
return StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
flex: 1,
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
backgroundColor: theme.colors.background,
|
|
13
|
+
position: 'relative',
|
|
14
|
+
},
|
|
15
|
+
topLabel: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: isPortrait ? 60 : 20,
|
|
18
|
+
fontSize: 18,
|
|
19
|
+
width: '100%',
|
|
20
|
+
textAlign: 'center',
|
|
21
|
+
zIndex: 5,
|
|
22
|
+
color: '#fff',
|
|
23
|
+
},
|
|
24
|
+
bottomLabel: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
bottom: isPortrait ? 140 : 20,
|
|
27
|
+
fontSize: 16,
|
|
28
|
+
width: '100%',
|
|
29
|
+
textAlign: 'center',
|
|
30
|
+
zIndex: 5,
|
|
31
|
+
color: '#fff',
|
|
32
|
+
},
|
|
33
|
+
camera: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
},
|
|
36
|
+
button: {
|
|
37
|
+
width: 100,
|
|
38
|
+
height: 50,
|
|
39
|
+
},
|
|
40
|
+
cardoverlay: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
width: '100%',
|
|
43
|
+
height: '100%',
|
|
44
|
+
top: 0,
|
|
45
|
+
bottom: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
},
|
|
49
|
+
buttonplace: {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
bottom: isPortrait ? 50 : 20,
|
|
52
|
+
left: '50%',
|
|
53
|
+
marginLeft: -35,
|
|
54
|
+
},
|
|
55
|
+
captureButton: {
|
|
56
|
+
width: 70,
|
|
57
|
+
height: 70,
|
|
58
|
+
backgroundColor: 'white',
|
|
59
|
+
borderRadius: 35,
|
|
60
|
+
borderWidth: 4,
|
|
61
|
+
borderColor: '#ccc',
|
|
62
|
+
},
|
|
63
|
+
text: {
|
|
64
|
+
color: '#fff',
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
textAlign: 'center',
|
|
67
|
+
marginBottom: 20,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
};
|
|
@@ -6,13 +6,22 @@ export default (theme: Theme, orientation: Orientation) =>
|
|
|
6
6
|
StyleSheet.create({
|
|
7
7
|
footer: {
|
|
8
8
|
position: 'absolute',
|
|
9
|
-
bottom:
|
|
9
|
+
bottom: 25,
|
|
10
10
|
left: 0,
|
|
11
11
|
right: 0,
|
|
12
12
|
alignItems: 'center',
|
|
13
13
|
},
|
|
14
|
+
container: {
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
},
|
|
14
18
|
text: {
|
|
15
19
|
fontSize: 14,
|
|
20
|
+
fontWeight:700,
|
|
16
21
|
color: theme.colors.text,
|
|
17
22
|
},
|
|
23
|
+
logo: {
|
|
24
|
+
width: 40,
|
|
25
|
+
height: 35,
|
|
26
|
+
},
|
|
18
27
|
});
|
|
@@ -8,21 +8,58 @@ export default (theme: Theme, orientation: Orientation) => {
|
|
|
8
8
|
return StyleSheet.create({
|
|
9
9
|
container: {
|
|
10
10
|
flex: 1,
|
|
11
|
-
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
backgroundColor: theme.colors.background,
|
|
13
|
+
position: 'relative',
|
|
14
|
+
},
|
|
15
|
+
topLabel: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: isPortrait ? 80 : 20,
|
|
18
|
+
fontSize: 18,
|
|
19
|
+
fontWeight: '700',
|
|
20
|
+
width: '100%',
|
|
21
|
+
textAlign: 'center',
|
|
22
|
+
zIndex: 5,
|
|
23
|
+
color: '#fff',
|
|
24
|
+
},
|
|
25
|
+
bottomLabel: {
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
bottom: isPortrait ? 140 : 20,
|
|
28
|
+
fontSize: 16,
|
|
29
|
+
width: '100%',
|
|
30
|
+
textAlign: 'center',
|
|
31
|
+
zIndex: 5,
|
|
32
|
+
color: '#fff',
|
|
12
33
|
},
|
|
13
34
|
camera: {
|
|
14
35
|
flex: 1,
|
|
15
36
|
},
|
|
16
|
-
|
|
37
|
+
overlay: {
|
|
17
38
|
position: 'absolute',
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
39
|
+
width: '100%',
|
|
40
|
+
height: '50%',
|
|
41
|
+
top: '20%',
|
|
42
|
+
bottom: 0,
|
|
43
|
+
left: 0,
|
|
44
|
+
right: 0,
|
|
45
|
+
},
|
|
46
|
+
captureButton: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
bottom: isPortrait ? 50 : 20,
|
|
49
|
+
left: '50%',
|
|
50
|
+
marginLeft: -35,
|
|
51
|
+
width: 70,
|
|
52
|
+
height: 70,
|
|
53
|
+
backgroundColor: 'white',
|
|
54
|
+
borderRadius: 35,
|
|
55
|
+
borderWidth: 4,
|
|
56
|
+
borderColor: '#ccc',
|
|
57
|
+
},
|
|
58
|
+
text: {
|
|
59
|
+
color: theme.colors.text,
|
|
60
|
+
fontSize: 16,
|
|
24
61
|
textAlign: 'center',
|
|
25
|
-
|
|
62
|
+
marginBottom: 20,
|
|
26
63
|
},
|
|
27
64
|
});
|
|
28
65
|
};
|
|
@@ -2,30 +2,27 @@ import { StyleSheet } from 'react-native';
|
|
|
2
2
|
import { Theme } from '../types';
|
|
3
3
|
import { Orientation } from '../hooks/useOrientation';
|
|
4
4
|
|
|
5
|
-
export default (theme: Theme, orientation: Orientation) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return StyleSheet.create({
|
|
5
|
+
export default (theme: Theme, orientation: Orientation) =>
|
|
6
|
+
StyleSheet.create({
|
|
9
7
|
container: {
|
|
10
8
|
flex: 1,
|
|
11
9
|
backgroundColor: theme.colors.background,
|
|
12
10
|
alignItems: 'center',
|
|
13
|
-
justifyContent: 'center',
|
|
14
11
|
paddingHorizontal: 20,
|
|
12
|
+
paddingTop: 0,
|
|
13
|
+
justifyContent: 'center',
|
|
15
14
|
},
|
|
16
15
|
maintitle: {
|
|
17
16
|
textAlign: 'center',
|
|
18
|
-
fontWeight: '
|
|
19
|
-
marginBottom:
|
|
17
|
+
fontWeight: '700',
|
|
18
|
+
marginBottom: 0,
|
|
20
19
|
color: theme.colors.text,
|
|
21
|
-
fontSize: 32,
|
|
22
20
|
},
|
|
23
21
|
subtitle: {
|
|
24
|
-
textAlign: 'center',
|
|
25
22
|
fontWeight: '300',
|
|
26
|
-
color: theme.colors.subtitle,
|
|
27
23
|
fontSize: 20,
|
|
24
|
+
color: theme.colors.subtitle,
|
|
25
|
+
textAlign: 'center',
|
|
28
26
|
lineHeight: 30,
|
|
29
27
|
},
|
|
30
28
|
});
|
|
31
|
-
};
|