@test-web/react-native-sdk 2.2.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.
Files changed (78) hide show
  1. package/android/build/.transforms/246c075ea944392e66db7aa639265547/results.bin +1 -0
  2. package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/yourcompany/sdk/BuildConfig.dex +0 -0
  3. package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/yourcompany/sdk/YourSDKModule.dex +0 -0
  4. package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/yourcompany/sdk/YourSDKPackage.dex +0 -0
  5. package/android/build/.transforms/246c075ea944392e66db7aa639265547/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  6. package/android/build/.transforms/952af5a0e7b5b2ac3d48ad66eccefd1f/results.bin +1 -0
  7. package/android/build/.transforms/952af5a0e7b5b2ac3d48ad66eccefd1f/transformed/classes/classes_dex/classes.dex +0 -0
  8. package/android/build/generated/source/buildConfig/debug/com/yourcompany/sdk/BuildConfig.java +10 -0
  9. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +34 -0
  10. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  11. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  12. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  13. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  14. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  15. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  16. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  17. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  18. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  19. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  20. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  21. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/yourcompany/sdk/BuildConfig.class +0 -0
  22. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/yourcompany/sdk/YourSDKModule.class +0 -0
  23. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/yourcompany/sdk/YourSDKPackage.class +0 -0
  24. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  25. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +56 -0
  26. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +34 -0
  27. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  28. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  29. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/yourcompany/sdk/BuildConfig.class +0 -0
  30. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/yourcompany/sdk/YourSDKModule.class +0 -0
  31. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/yourcompany/sdk/YourSDKPackage.class +0 -0
  32. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  33. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  34. package/android/build/outputs/logs/manifest-merger-debug-report.txt +61 -0
  35. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  36. package/package.json +1 -1
  37. package/src/apis/captureBarcode.ts +37 -0
  38. package/src/apis/captureMRZ.ts +39 -0
  39. package/src/apis/checkLiveness.ts +48 -0
  40. package/src/apis/index.ts +26 -75
  41. package/src/components/common/Footer.tsx +19 -22
  42. package/src/components/common/Header.tsx +22 -21
  43. package/src/components/common/Loader.tsx +9 -28
  44. package/src/components/ui/Button.tsx +23 -31
  45. package/src/components/ui/ThemedText.tsx +21 -32
  46. package/src/context/FailedCountContext.tsx +35 -0
  47. package/src/context/IDMConfigurationContext.tsx +12 -2
  48. package/src/context/themes.ts +20 -0
  49. package/src/index.tsx +41 -29
  50. package/src/screens/BackDocumentAdvice.tsx +13 -18
  51. package/src/screens/BarcodeAdvice.tsx +39 -19
  52. package/src/screens/BarcodeCapture.tsx +127 -158
  53. package/src/screens/DocumentCaptureBack.tsx +145 -102
  54. package/src/screens/DocumentCaptureFront.tsx +146 -113
  55. package/src/screens/FrontDocumentAdvice.tsx +13 -18
  56. package/src/screens/LocationPermission.tsx +124 -17
  57. package/src/screens/MrzAdvice.tsx +27 -13
  58. package/src/screens/MrzCapture.tsx +233 -206
  59. package/src/screens/SelectDocuments.tsx +57 -66
  60. package/src/screens/SelfieAdvice.tsx +2 -3
  61. package/src/screens/SelfieCapture.tsx +135 -103
  62. package/src/screens/ThankYou.tsx +25 -31
  63. package/src/screens/VerifyIdentity.tsx +1 -0
  64. package/src/styles/BarcodeAdviceStyles.ts +6 -6
  65. package/src/styles/DocumentCaptureBackStyle.ts +70 -0
  66. package/src/styles/DocumentCaptureFrontStyle.ts +70 -0
  67. package/src/styles/FooterStyles.ts +27 -0
  68. package/src/styles/HeaderStyles.ts +20 -0
  69. package/src/styles/LoaderStyles.ts +14 -0
  70. package/src/styles/ScannerStyles.ts +46 -9
  71. package/src/styles/ThankYouStyles.ts +8 -11
  72. package/src/types/index.ts +8 -0
  73. package/src/utils/MRZ_README.md +111 -0
  74. package/src/utils/imagesHelper.ts +264 -0
  75. package/src/utils/metadata_new.json +11373 -1
  76. package/src/utils/mrzExamples.ts +127 -0
  77. package/src/utils/mrzParser.ts +303 -0
  78. package/src/utils/mrzUtils.ts +70 -0
@@ -17,12 +17,11 @@ export default function SelfieAdvice() {
17
17
  <ThemedText style={styles.maintitle} type="title">
18
18
  Take a Selfie
19
19
  </ThemedText>
20
- {/* Add selfie.jpg image to assets/images/ */}
21
- {/* <Image
20
+ <Image
22
21
  source={require('../../assets/images/selfie.jpg')}
23
22
  style={styles.selfie}
24
23
  resizeMode="contain"
25
- /> */}
24
+ />
26
25
  <Text style={styles.text}>You have to allow Camera Permission.</Text>
27
26
  <Button
28
27
  title="Take a Selfie"
@@ -1,148 +1,180 @@
1
- import React, { useState, useCallback, useEffect, useRef } from 'react';
1
+ import React, { useState, useEffect, useRef } from 'react';
2
2
  import { useNavigation } from '@react-navigation/native';
3
- import { TouchableOpacity, View, StyleSheet, Text, Alert } from 'react-native';
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 { processImageToBase64, validateImagePath } from '../utils/imageProcessor';
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, setIDMConf } = useIDM();
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 [hasPermission, setHasPermission] = useState(false);
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
- const initializeCamera = async () => {
25
- try {
26
- const { Camera, useCameraDevice, useCameraPermission } = require('react-native-vision-camera');
27
-
28
- const { hasPermission: hasPerm, requestPermission } = useCameraPermission();
29
-
30
- if (!hasPerm) {
31
- const granted = await requestPermission();
32
- if (!granted) {
33
- navigation.navigate('CameraPermission' as never);
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
- setDevice(frontDevice);
48
- } catch (error) {
49
- console.warn('Camera initialization failed:', error);
50
- setHasPermission(true);
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
- initializeCamera();
55
- }, [navigation]);
69
+ if (!device) return null;
56
70
 
57
- const takePhoto = useCallback(async () => {
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
- if (!validateImagePath(photo?.path)) {
71
- Alert.alert('Error', 'Failed to capture selfie');
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
- // Process image to base64
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
- // Navigate to document selection
90
- navigation.navigate('SelectDocuments' as never);
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('Error taking selfie:', 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
- }, [idmConf, setIDMConf, navigation]);
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
- {renderCamera()}
132
-
133
- {/* Camera overlay - Add your overlay image to assets/images/photo-overlay.png */}
134
- {/* <Image
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
- resizeMode="contain"
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
- activeOpacity={0.7}
177
+ disabled={loading}
146
178
  />
147
179
  </View>
148
180
 
@@ -1,56 +1,50 @@
1
- import React, { useEffect, useState } from 'react';
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
- const finalizeVerification = async () => {
22
- if (completed || !idmConf.verificationCode) return;
23
-
24
- try {
25
- setLoading(true);
26
- const result = await completeVerification(idmConf);
27
- console.log('Verification completed:', result);
28
- setCompleted(true);
29
- } catch (error: any) {
30
- console.error('Error completing verification:', error);
31
- // Don't show error to user, just log it
32
- } finally {
33
- setLoading(false);
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
- // Call after a short delay to ensure all data is submitted
38
- const timer = setTimeout(() => {
39
- finalizeVerification();
40
- }, 1000);
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 message="Finalizing verification..." />}
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: isPortrait ? 30 : 15,
19
+ marginBottom: 0,
20
20
  color: theme.colors.text,
21
21
  },
22
22
  idcard: {
23
- marginTop: isPortrait ? 20 : 10,
23
+ marginTop: isPortrait ? 30 : 10,
24
24
  marginBottom: 0,
25
- width: isPortrait ? 300 : 200,
26
- height: isPortrait ? 200 : 150,
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: 6,
40
- paddingHorizontal: 15,
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
+ };
@@ -0,0 +1,27 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { Theme } from '../types/IDMConf';
3
+ import { Orientation } from '../hooks/useOrientation';
4
+
5
+ export default (theme: Theme, orientation: Orientation) =>
6
+ StyleSheet.create({
7
+ footer: {
8
+ position: 'absolute',
9
+ bottom: 25,
10
+ left: 0,
11
+ right: 0,
12
+ alignItems: 'center',
13
+ },
14
+ container: {
15
+ flexDirection: 'row',
16
+ alignItems: 'center',
17
+ },
18
+ text: {
19
+ fontSize: 14,
20
+ fontWeight:700,
21
+ color: theme.colors.text,
22
+ },
23
+ logo: {
24
+ width: 40,
25
+ height: 35,
26
+ },
27
+ });
@@ -0,0 +1,20 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { Theme } from '../types/IDMConf';
3
+ import { Orientation } from '../hooks/useOrientation';
4
+
5
+ export default (theme: Theme, orientation: Orientation) =>
6
+ StyleSheet.create({
7
+ container: {
8
+ left: 0,
9
+ right: 0,
10
+ alignItems: 'center',
11
+ backgroundColor: theme.colors.background,
12
+ },
13
+ logo: {
14
+ marginHorizontal: 'auto',
15
+ marginTop: '5%',
16
+ marginBottom: 0,
17
+ width: 190,
18
+ height: 76,
19
+ },
20
+ });
@@ -0,0 +1,14 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { Theme } from '../types/IDMConf';
3
+ import { Orientation } from '../hooks/useOrientation';
4
+
5
+ export default (theme: Theme, orientation: Orientation) =>
6
+ StyleSheet.create({
7
+ loadingContainer: {
8
+ ...StyleSheet.absoluteFillObject,
9
+ backgroundColor: 'rgba(0,0,0,0.5)',
10
+ justifyContent: 'center',
11
+ alignItems: 'center',
12
+ zIndex: 10,
13
+ },
14
+ });