omnipay-reactnative-sdk 1.2.2-beta.9 → 1.2.3-beta.10
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/README.md +58 -48
- package/android/build.gradle +4 -7
- package/android/src/main/AndroidManifest.xml +0 -5
- package/android/src/main/java/com/omniretail/omnipay/FaceVerificationFrameProcessor.kt +111 -0
- package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +6 -4
- package/ios/FaceVerificationFrameProcessor.swift +138 -0
- package/ios/FaceVerificationFrameProcessorPlugin.m +4 -0
- package/ios/OmnipayReactnativeSdk.m +5 -0
- package/ios/OmnipayReactnativeSdk.swift +10 -0
- package/ios/omnipay_reactnative_sdk.h +6 -0
- package/lib/commonjs/components/Button.js +68 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/OmnipayProvider.js +7 -23
- package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
- package/lib/commonjs/components/biometrics/FaceVerification.js +294 -270
- package/lib/commonjs/components/biometrics/FaceVerification.js.map +1 -1
- package/lib/commonjs/components/biometrics/useFaceVerification.js +85 -0
- package/lib/commonjs/components/biometrics/useFaceVerification.js.map +1 -0
- package/lib/commonjs/components/biometrics/useFaceVerificationFlow.js +157 -0
- package/lib/commonjs/components/biometrics/useFaceVerificationFlow.js.map +1 -0
- package/lib/commonjs/index.js +0 -33
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Button.js +61 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/OmnipayProvider.js +7 -23
- package/lib/module/components/OmnipayProvider.js.map +1 -1
- package/lib/module/components/biometrics/FaceVerification.js +294 -271
- package/lib/module/components/biometrics/FaceVerification.js.map +1 -1
- package/lib/module/components/biometrics/useFaceVerification.js +78 -0
- package/lib/module/components/biometrics/useFaceVerification.js.map +1 -0
- package/lib/module/components/biometrics/useFaceVerificationFlow.js +150 -0
- package/lib/module/components/biometrics/useFaceVerificationFlow.js.map +1 -0
- package/lib/module/index.js +0 -6
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/Button.d.ts +17 -0
- package/lib/typescript/components/Button.d.ts.map +1 -0
- package/lib/typescript/components/OmnipayProvider.d.ts.map +1 -1
- package/lib/typescript/components/biometrics/FaceVerification.d.ts +1 -3
- package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +1 -1
- package/lib/typescript/components/biometrics/useFaceVerification.d.ts +38 -0
- package/lib/typescript/components/biometrics/useFaceVerification.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/useFaceVerificationFlow.d.ts +29 -0
- package/lib/typescript/components/biometrics/useFaceVerificationFlow.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +0 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/omnipay_reactnative_sdk.podspec +46 -0
- package/package.json +5 -8
- package/src/components/Button.tsx +86 -0
- package/src/components/OmnipayProvider.tsx +7 -24
- package/src/components/biometrics/FaceVerification.tsx +315 -309
- package/src/components/biometrics/useFaceVerification.ts +120 -0
- package/src/components/biometrics/useFaceVerificationFlow.ts +224 -0
- package/src/index.tsx +0 -7
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraView.java +0 -153
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraViewManager.java +0 -49
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessModule.java +0 -557
- package/ios/OmnipayLivenessCameraView.h +0 -15
- package/ios/OmnipayLivenessCameraView.m +0 -80
- package/ios/OmnipayLivenessCameraViewManager.m +0 -19
- package/ios/OmnipayLivenessModule.h +0 -38
- package/ios/OmnipayLivenessModule.m +0 -615
- package/lib/commonjs/components/biometrics/LivenessDetection.js +0 -149
- package/lib/commonjs/components/biometrics/LivenessDetection.js.map +0 -1
- package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js +0 -15
- package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js.map +0 -1
- package/lib/commonjs/components/biometrics/PermissionManager.js +0 -279
- package/lib/commonjs/components/biometrics/PermissionManager.js.map +0 -1
- package/lib/commonjs/components/biometrics/index.js +0 -45
- package/lib/commonjs/components/biometrics/index.js.map +0 -1
- package/lib/commonjs/components/biometrics/types.js +0 -17
- package/lib/commonjs/components/biometrics/types.js.map +0 -1
- package/lib/module/components/biometrics/LivenessDetection.js +0 -129
- package/lib/module/components/biometrics/LivenessDetection.js.map +0 -1
- package/lib/module/components/biometrics/OmnipayLivenessCameraView.js +0 -7
- package/lib/module/components/biometrics/OmnipayLivenessCameraView.js.map +0 -1
- package/lib/module/components/biometrics/PermissionManager.js +0 -272
- package/lib/module/components/biometrics/PermissionManager.js.map +0 -1
- package/lib/module/components/biometrics/index.js +0 -12
- package/lib/module/components/biometrics/index.js.map +0 -1
- package/lib/module/components/biometrics/types.js +0 -16
- package/lib/module/components/biometrics/types.js.map +0 -1
- package/lib/typescript/components/biometrics/LivenessDetection.d.ts +0 -33
- package/lib/typescript/components/biometrics/LivenessDetection.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts +0 -18
- package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/PermissionManager.d.ts +0 -58
- package/lib/typescript/components/biometrics/PermissionManager.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/index.d.ts +0 -5
- package/lib/typescript/components/biometrics/index.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/types.d.ts +0 -73
- package/lib/typescript/components/biometrics/types.d.ts.map +0 -1
- package/omnipay-reactnative-sdk.podspec +0 -50
- package/src/components/biometrics/LivenessDetection.ts +0 -178
- package/src/components/biometrics/OmnipayLivenessCameraView.tsx +0 -19
- package/src/components/biometrics/PermissionManager.ts +0 -317
- package/src/components/biometrics/index.ts +0 -11
- package/src/components/biometrics/types.ts +0 -86
|
@@ -1,158 +1,116 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { View, Modal, Dimensions, StyleSheet, TouchableOpacity, Image, Text
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { View, Modal, Dimensions, Platform, StyleSheet, TouchableOpacity, Image, Text } from 'react-native';
|
|
3
|
+
import { Camera, useCameraDevice, useCameraPermission } from 'react-native-vision-camera';
|
|
4
|
+
import Button from '../Button';
|
|
5
|
+
import { useFaceVerification } from './useFaceVerification';
|
|
6
|
+
import { useFaceVerificationFlow } from './useFaceVerificationFlow';
|
|
7
7
|
const FaceVerification = ({
|
|
8
8
|
onClose,
|
|
9
9
|
onSuccess,
|
|
10
|
-
primaryColor
|
|
11
|
-
config
|
|
10
|
+
primaryColor
|
|
12
11
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
checkSupport();
|
|
20
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
-
}, []);
|
|
22
|
-
const checkSupport = async () => {
|
|
23
|
-
try {
|
|
24
|
-
console.log('🔍 Starting liveness detection initialization...');
|
|
12
|
+
const device = useCameraDevice('front');
|
|
13
|
+
const {
|
|
14
|
+
hasPermission,
|
|
15
|
+
requestPermission
|
|
16
|
+
} = useCameraPermission();
|
|
17
|
+
const [isRequestingPermission, setIsRequestingPermission] = useState(false);
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
console.log('✅ Camera permission granted');
|
|
19
|
+
// Face verification flow
|
|
20
|
+
const {
|
|
21
|
+
state: flowState,
|
|
22
|
+
resetFlow,
|
|
23
|
+
isCompleted,
|
|
24
|
+
isFailed
|
|
25
|
+
} = useFaceVerificationFlow();
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
console.log('❌ Device does not support liveness detection');
|
|
47
|
-
setState('failed');
|
|
48
|
-
setError('Liveness detection is not supported on this device');
|
|
49
|
-
}
|
|
50
|
-
} catch (err) {
|
|
51
|
-
console.error('💥 Error during initialization:', err);
|
|
52
|
-
setState('failed');
|
|
53
|
-
setError('Failed to initialize liveness detection');
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const startDetection = async () => {
|
|
57
|
-
if (!isSupported) {
|
|
58
|
-
return;
|
|
27
|
+
// Frame processor
|
|
28
|
+
const frameProcessor = useFaceVerification();
|
|
29
|
+
|
|
30
|
+
// Handle completion
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (isCompleted) {
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
onSuccess();
|
|
35
|
+
}, 1000); // Show success message briefly
|
|
59
36
|
}
|
|
60
|
-
|
|
61
|
-
|
|
37
|
+
}, [isCompleted, onSuccess]);
|
|
38
|
+
const handleRequestPermission = async () => {
|
|
39
|
+
setIsRequestingPermission(true);
|
|
62
40
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
const result = await LivenessDetection.startDetection(livenessConfig, {
|
|
70
|
-
onChallengeStart: challenge => {
|
|
71
|
-
setCurrentChallenge(challenge);
|
|
72
|
-
setState('running');
|
|
73
|
-
setChallengeProgress(getChallengeInstruction(challenge));
|
|
74
|
-
},
|
|
75
|
-
onChallengeSuccess: (challenge, _challengeResult) => {
|
|
76
|
-
setChallengeProgress(`✓ ${getChallengeInstruction(challenge)} completed`);
|
|
77
|
-
},
|
|
78
|
-
onChallengeFailure: (challenge, reason) => {
|
|
79
|
-
setError(`Failed: ${reason}, ${challenge}`);
|
|
80
|
-
},
|
|
81
|
-
onAllChallengesComplete: () => {
|
|
82
|
-
setChallengeProgress('All challenges completed! Taking final photo...');
|
|
83
|
-
},
|
|
84
|
-
onScreenshotCaptured: _screenshot => {
|
|
85
|
-
// Screenshot captured, detection will complete soon
|
|
86
|
-
},
|
|
87
|
-
onDetectionFailed: reason => {
|
|
88
|
-
setError(reason);
|
|
89
|
-
setState('failed');
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
if (result.success) {
|
|
93
|
-
setState('completed');
|
|
94
|
-
setTimeout(() => {
|
|
95
|
-
onSuccess(result);
|
|
96
|
-
}, 1000); // Brief delay to show success state
|
|
97
|
-
} else {
|
|
98
|
-
setState('failed');
|
|
99
|
-
setError(result.failureReason || 'Face verification failed');
|
|
100
|
-
}
|
|
101
|
-
} catch (err) {
|
|
102
|
-
setState('failed');
|
|
103
|
-
setError(err instanceof Error ? err.message : 'Unknown error occurred');
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
const getChallengeInstruction = challenge => {
|
|
107
|
-
switch (challenge) {
|
|
108
|
-
case LivenessChallenge.SMILE:
|
|
109
|
-
return 'Please smile';
|
|
110
|
-
case LivenessChallenge.BLINK:
|
|
111
|
-
return 'Please blink';
|
|
112
|
-
case LivenessChallenge.TURN_LEFT:
|
|
113
|
-
return 'Please turn your head left';
|
|
114
|
-
case LivenessChallenge.TURN_RIGHT:
|
|
115
|
-
return 'Please turn your head right';
|
|
116
|
-
default:
|
|
117
|
-
return 'Follow the instruction';
|
|
41
|
+
await requestPermission();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error('Error requesting camera permission:', error);
|
|
44
|
+
} finally {
|
|
45
|
+
setIsRequestingPermission(false);
|
|
118
46
|
}
|
|
119
47
|
};
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
48
|
+
const renderPermissionRequest = () => /*#__PURE__*/React.createElement(View, {
|
|
49
|
+
style: styles.permissionContainer
|
|
50
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
51
|
+
style: styles.permissionIconContainer
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
53
|
+
style: styles.permissionIcon
|
|
54
|
+
}, "\uD83D\uDCF7")), /*#__PURE__*/React.createElement(Text, {
|
|
55
|
+
style: styles.permissionTitle
|
|
56
|
+
}, "Camera Permission Required"), /*#__PURE__*/React.createElement(Text, {
|
|
57
|
+
style: styles.permissionDescription
|
|
58
|
+
}, "To verify your identity, we need access to your camera. This allows us to capture your face for secure verification."), /*#__PURE__*/React.createElement(Button, {
|
|
59
|
+
title: "Allow Camera Access",
|
|
60
|
+
onPress: handleRequestPermission,
|
|
61
|
+
backgroundColor: primaryColor,
|
|
62
|
+
loading: isRequestingPermission
|
|
63
|
+
}));
|
|
64
|
+
const renderNoDevice = () => /*#__PURE__*/React.createElement(View, {
|
|
65
|
+
style: styles.errorContainer
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
67
|
+
style: styles.errorTitle
|
|
68
|
+
}, "Camera Not Available"), /*#__PURE__*/React.createElement(Text, {
|
|
69
|
+
style: styles.errorSubtitle
|
|
70
|
+
}, "No front camera detected on this device. Face verification requires a front-facing camera."));
|
|
71
|
+
const renderCamera = () => {
|
|
72
|
+
if (!device) return null;
|
|
73
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
74
|
+
style: styles.cameraContainer
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Camera, {
|
|
76
|
+
device: device,
|
|
77
|
+
style: styles.camera,
|
|
78
|
+
isActive: true,
|
|
79
|
+
frameProcessor: frameProcessor
|
|
80
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
81
|
+
style: styles.cameraOverlay
|
|
82
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
83
|
+
style: styles.faceFrame
|
|
84
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
85
|
+
style: styles.progressContainer
|
|
86
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
style: [styles.progressBar, {
|
|
88
|
+
width: `${flowState.progress}%`,
|
|
89
|
+
backgroundColor: primaryColor
|
|
90
|
+
}]
|
|
91
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
92
|
+
style: styles.instructionText
|
|
93
|
+
}, flowState.instruction), /*#__PURE__*/React.createElement(Text, {
|
|
94
|
+
style: styles.stepIndicator
|
|
95
|
+
}, "Step ", flowState.completedSteps.length + 1, " of 5"), isCompleted && /*#__PURE__*/React.createElement(View, {
|
|
96
|
+
style: [styles.statusContainer, {
|
|
97
|
+
backgroundColor: primaryColor
|
|
98
|
+
}]
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
100
|
+
style: styles.statusText
|
|
101
|
+
}, "\u2713 Verification Complete!")), isFailed && /*#__PURE__*/React.createElement(View, {
|
|
102
|
+
style: [styles.statusContainer, styles.statusContainerError]
|
|
103
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
104
|
+
style: styles.statusText
|
|
105
|
+
}, "\u2717 Verification Failed"), /*#__PURE__*/React.createElement(Button, {
|
|
106
|
+
title: "Try Again",
|
|
107
|
+
onPress: resetFlow,
|
|
108
|
+
backgroundColor: "white",
|
|
109
|
+
textColor: "#ff4444",
|
|
110
|
+
style: styles.retryButton
|
|
111
|
+
}))));
|
|
154
112
|
};
|
|
155
|
-
|
|
113
|
+
console.log(onSuccess, primaryColor);
|
|
156
114
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
157
115
|
visible: true,
|
|
158
116
|
transparent: true,
|
|
@@ -161,7 +119,7 @@ const FaceVerification = ({
|
|
|
161
119
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
162
120
|
style: styles.backdrop,
|
|
163
121
|
activeOpacity: 1,
|
|
164
|
-
onPress:
|
|
122
|
+
onPress: onClose
|
|
165
123
|
}, /*#__PURE__*/React.createElement(View, {
|
|
166
124
|
style: [styles.container]
|
|
167
125
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
@@ -172,178 +130,243 @@ const FaceVerification = ({
|
|
|
172
130
|
style: styles.closeIcon
|
|
173
131
|
})), /*#__PURE__*/React.createElement(View, {
|
|
174
132
|
style: styles.contentContainer
|
|
175
|
-
},
|
|
176
|
-
style: styles.title
|
|
177
|
-
}, "Face Verification"), /*#__PURE__*/React.createElement(View, {
|
|
178
|
-
style: styles.cameraContainer
|
|
179
|
-
}, state === 'running' && isSupported ? /*#__PURE__*/React.createElement(OmnipayLivenessCameraView, {
|
|
180
|
-
style: styles.camera
|
|
181
|
-
}) : /*#__PURE__*/React.createElement(View, {
|
|
182
|
-
style: [styles.camera, styles.cameraPlaceholder]
|
|
183
|
-
}, state === 'initializing' || state === 'starting' ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
184
|
-
size: "large",
|
|
185
|
-
color: primaryColor
|
|
186
|
-
}) : state === 'completed' ? /*#__PURE__*/React.createElement(View, {
|
|
187
|
-
style: styles.successIcon
|
|
188
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
189
|
-
style: styles.successText
|
|
190
|
-
}, "\u2713")) : /*#__PURE__*/React.createElement(View, {
|
|
191
|
-
style: styles.errorIcon
|
|
192
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
193
|
-
style: styles.errorText
|
|
194
|
-
}, "!"))), /*#__PURE__*/React.createElement(View, {
|
|
195
|
-
style: styles.overlay
|
|
196
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
197
|
-
style: [styles.instruction, {
|
|
198
|
-
color: getStateColor()
|
|
199
|
-
}]
|
|
200
|
-
}, getStateMessage()))), state === 'running' && currentChallenge && /*#__PURE__*/React.createElement(View, {
|
|
201
|
-
style: styles.progressContainer
|
|
202
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
203
|
-
style: styles.challengeText
|
|
204
|
-
}, getChallengeInstruction(currentChallenge))), /*#__PURE__*/React.createElement(View, {
|
|
205
|
-
style: styles.buttonContainer
|
|
206
|
-
}, showRetryButton && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
207
|
-
style: [styles.retryButton, {
|
|
208
|
-
backgroundColor: primaryColor
|
|
209
|
-
}],
|
|
210
|
-
onPress: handleRetry
|
|
211
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
212
|
-
style: styles.retryButtonText
|
|
213
|
-
}, "Try Again")))))));
|
|
133
|
+
}, !hasPermission && renderPermissionRequest(), hasPermission && !device && renderNoDevice(), hasPermission && device && renderCamera()))));
|
|
214
134
|
};
|
|
215
|
-
|
|
216
|
-
width: screenWidth,
|
|
217
|
-
height: screenHeight
|
|
218
|
-
} = Dimensions.get('window');
|
|
135
|
+
export default FaceVerification;
|
|
219
136
|
const styles = StyleSheet.create({
|
|
220
|
-
|
|
221
|
-
|
|
137
|
+
hide: {
|
|
138
|
+
display: 'none'
|
|
222
139
|
},
|
|
223
|
-
|
|
140
|
+
full: {
|
|
141
|
+
flex: 1,
|
|
142
|
+
width: '100%',
|
|
143
|
+
height: '100%'
|
|
144
|
+
},
|
|
145
|
+
webview: {
|
|
224
146
|
flex: 1,
|
|
225
|
-
|
|
147
|
+
width: '100%',
|
|
148
|
+
height: Dimensions.get('window').height - 40,
|
|
149
|
+
backgroundColor: 'white',
|
|
150
|
+
borderTopRightRadius: 20,
|
|
151
|
+
borderTopLeftRadius: 20,
|
|
152
|
+
paddingTop: 150
|
|
153
|
+
},
|
|
154
|
+
webviewLoader: {
|
|
155
|
+
zIndex: 3,
|
|
156
|
+
backgroundColor: 'white',
|
|
157
|
+
alignItems: 'center',
|
|
226
158
|
justifyContent: 'center',
|
|
227
|
-
|
|
159
|
+
flex: 1,
|
|
160
|
+
width: '100%',
|
|
161
|
+
height: '100%',
|
|
162
|
+
position: 'absolute',
|
|
163
|
+
top: 0,
|
|
164
|
+
left: 0,
|
|
165
|
+
borderTopRightRadius: 20,
|
|
166
|
+
borderTopLeftRadius: 20
|
|
167
|
+
},
|
|
168
|
+
backdrop: {
|
|
169
|
+
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
170
|
+
flex: 1,
|
|
171
|
+
justifyContent: 'flex-end',
|
|
172
|
+
position: 'relative',
|
|
173
|
+
height: '100%'
|
|
228
174
|
},
|
|
229
175
|
container: {
|
|
230
|
-
width: screenWidth * 0.9,
|
|
231
|
-
maxHeight: screenHeight * 0.8,
|
|
232
176
|
backgroundColor: 'white',
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
177
|
+
borderTopRightRadius: 20,
|
|
178
|
+
borderTopLeftRadius: 20,
|
|
179
|
+
maxHeight: Dimensions.get('window').height - 120,
|
|
180
|
+
flex: 1,
|
|
181
|
+
position: 'relative',
|
|
182
|
+
...(Platform.OS === 'android' && {
|
|
183
|
+
overflow: 'hidden'
|
|
184
|
+
})
|
|
185
|
+
},
|
|
186
|
+
modal: {
|
|
187
|
+
flex: 1,
|
|
188
|
+
backgroundColor: 'rgba(0,0,0,0.48)',
|
|
189
|
+
height: '100%',
|
|
190
|
+
width: '100%'
|
|
236
191
|
},
|
|
237
192
|
close: {
|
|
238
193
|
position: 'absolute',
|
|
239
|
-
top:
|
|
240
|
-
right:
|
|
241
|
-
|
|
242
|
-
|
|
194
|
+
top: 10,
|
|
195
|
+
right: 10,
|
|
196
|
+
backgroundColor: 'white',
|
|
197
|
+
height: 24,
|
|
198
|
+
width: 24,
|
|
199
|
+
borderRadius: 1000,
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
zIndex: 2
|
|
243
203
|
},
|
|
244
204
|
closeIcon: {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
tintColor: '#666'
|
|
205
|
+
height: 12,
|
|
206
|
+
width: 12
|
|
248
207
|
},
|
|
249
208
|
contentContainer: {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
209
|
+
height: '100%',
|
|
210
|
+
position: 'relative',
|
|
211
|
+
borderTopRightRadius: 20,
|
|
212
|
+
borderTopLeftRadius: 20,
|
|
213
|
+
padding: 16
|
|
214
|
+
},
|
|
215
|
+
testContent: {
|
|
216
|
+
paddingTop: 30,
|
|
217
|
+
paddingLeft: 16
|
|
253
218
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
219
|
+
testTwoContent: {
|
|
220
|
+
paddingTop: 10,
|
|
221
|
+
paddingLeft: 16
|
|
222
|
+
},
|
|
223
|
+
errorSubtitle: {
|
|
224
|
+
textAlign: 'center',
|
|
225
|
+
fontSize: 14,
|
|
226
|
+
color: '#5e7079',
|
|
258
227
|
marginBottom: 20,
|
|
259
|
-
|
|
228
|
+
paddingHorizontal: 8,
|
|
229
|
+
marginTop: 14
|
|
260
230
|
},
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
231
|
+
errorContainer: {
|
|
232
|
+
flex: 1,
|
|
233
|
+
justifyContent: 'center',
|
|
234
|
+
alignItems: 'center',
|
|
235
|
+
width: Dimensions.get('window').width,
|
|
236
|
+
height: Dimensions.get('window').height,
|
|
237
|
+
zIndex: 2,
|
|
238
|
+
backgroundColor: 'white'
|
|
269
239
|
},
|
|
270
240
|
camera: {
|
|
271
|
-
flex: 1,
|
|
272
241
|
width: '100%',
|
|
273
|
-
height:
|
|
242
|
+
height: 400
|
|
274
243
|
},
|
|
275
|
-
|
|
244
|
+
// Permission request styles
|
|
245
|
+
permissionContainer: {
|
|
246
|
+
flex: 1,
|
|
276
247
|
justifyContent: 'center',
|
|
277
248
|
alignItems: 'center',
|
|
278
|
-
|
|
249
|
+
paddingHorizontal: 24,
|
|
250
|
+
paddingVertical: 40
|
|
279
251
|
},
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
252
|
+
permissionIconContainer: {
|
|
253
|
+
width: 80,
|
|
254
|
+
height: 80,
|
|
255
|
+
borderRadius: 40,
|
|
256
|
+
backgroundColor: '#f0f0f0',
|
|
257
|
+
justifyContent: 'center',
|
|
258
|
+
alignItems: 'center',
|
|
259
|
+
marginBottom: 24
|
|
288
260
|
},
|
|
289
|
-
|
|
290
|
-
fontSize:
|
|
261
|
+
permissionIcon: {
|
|
262
|
+
fontSize: 40
|
|
263
|
+
},
|
|
264
|
+
permissionTitle: {
|
|
265
|
+
fontSize: 20,
|
|
291
266
|
fontWeight: '600',
|
|
267
|
+
color: '#1a1a1a',
|
|
292
268
|
textAlign: 'center',
|
|
293
|
-
|
|
269
|
+
marginBottom: 12
|
|
294
270
|
},
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
271
|
+
permissionDescription: {
|
|
272
|
+
fontSize: 16,
|
|
273
|
+
color: '#666',
|
|
274
|
+
textAlign: 'center',
|
|
275
|
+
lineHeight: 22,
|
|
276
|
+
marginBottom: 32
|
|
298
277
|
},
|
|
299
|
-
|
|
278
|
+
// Error styles
|
|
279
|
+
errorTitle: {
|
|
300
280
|
fontSize: 18,
|
|
301
281
|
fontWeight: '600',
|
|
302
|
-
color: '#
|
|
303
|
-
textAlign: 'center'
|
|
282
|
+
color: '#1a1a1a',
|
|
283
|
+
textAlign: 'center',
|
|
284
|
+
marginBottom: 8
|
|
304
285
|
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
286
|
+
// Camera styles
|
|
287
|
+
cameraContainer: {
|
|
288
|
+
flex: 1,
|
|
289
|
+
position: 'relative',
|
|
290
|
+
marginTop: 60
|
|
309
291
|
},
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
292
|
+
cameraOverlay: {
|
|
293
|
+
position: 'absolute',
|
|
294
|
+
top: 0,
|
|
295
|
+
left: 0,
|
|
296
|
+
right: 0,
|
|
297
|
+
bottom: 0,
|
|
298
|
+
justifyContent: 'center',
|
|
314
299
|
alignItems: 'center'
|
|
315
300
|
},
|
|
316
|
-
|
|
301
|
+
faceFrame: {
|
|
302
|
+
width: 200,
|
|
303
|
+
height: 250,
|
|
304
|
+
borderWidth: 3,
|
|
305
|
+
borderColor: 'white',
|
|
306
|
+
borderRadius: 100,
|
|
307
|
+
borderStyle: 'dashed',
|
|
308
|
+
backgroundColor: 'transparent'
|
|
309
|
+
},
|
|
310
|
+
instructionText: {
|
|
317
311
|
color: 'white',
|
|
318
312
|
fontSize: 16,
|
|
319
|
-
fontWeight: '
|
|
313
|
+
fontWeight: '500',
|
|
314
|
+
textAlign: 'center',
|
|
315
|
+
marginTop: 20,
|
|
316
|
+
backgroundColor: 'rgba(0,0,0,0.7)',
|
|
317
|
+
paddingHorizontal: 16,
|
|
318
|
+
paddingVertical: 8,
|
|
319
|
+
borderRadius: 20
|
|
320
320
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
321
|
+
// Verification flow styles
|
|
322
|
+
progressContainer: {
|
|
323
|
+
position: 'absolute',
|
|
324
|
+
top: 20,
|
|
325
|
+
left: 20,
|
|
326
|
+
right: 20,
|
|
327
|
+
height: 4,
|
|
328
|
+
backgroundColor: 'rgba(255,255,255,0.3)',
|
|
329
|
+
borderRadius: 2,
|
|
330
|
+
overflow: 'hidden'
|
|
328
331
|
},
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
progressBar: {
|
|
333
|
+
height: '100%',
|
|
334
|
+
borderRadius: 2
|
|
335
|
+
},
|
|
336
|
+
stepIndicator: {
|
|
331
337
|
color: 'white',
|
|
332
|
-
|
|
338
|
+
fontSize: 14,
|
|
339
|
+
fontWeight: '400',
|
|
340
|
+
textAlign: 'center',
|
|
341
|
+
marginTop: 8,
|
|
342
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
343
|
+
paddingHorizontal: 12,
|
|
344
|
+
paddingVertical: 4,
|
|
345
|
+
borderRadius: 12,
|
|
346
|
+
alignSelf: 'center'
|
|
333
347
|
},
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
348
|
+
statusContainer: {
|
|
349
|
+
position: 'absolute',
|
|
350
|
+
bottom: 40,
|
|
351
|
+
left: 20,
|
|
352
|
+
right: 20,
|
|
353
|
+
padding: 20,
|
|
354
|
+
borderRadius: 12,
|
|
340
355
|
alignItems: 'center'
|
|
341
356
|
},
|
|
342
|
-
|
|
343
|
-
|
|
357
|
+
statusContainerError: {
|
|
358
|
+
backgroundColor: '#ff4444'
|
|
359
|
+
},
|
|
360
|
+
statusText: {
|
|
344
361
|
color: 'white',
|
|
345
|
-
|
|
362
|
+
fontSize: 18,
|
|
363
|
+
fontWeight: '600',
|
|
364
|
+
textAlign: 'center',
|
|
365
|
+
marginBottom: 8
|
|
366
|
+
},
|
|
367
|
+
retryButton: {
|
|
368
|
+
marginTop: 12,
|
|
369
|
+
minWidth: 120
|
|
346
370
|
}
|
|
347
371
|
});
|
|
348
|
-
export default FaceVerification;
|
|
349
372
|
//# sourceMappingURL=FaceVerification.js.map
|