@trustchex/react-native-sdk 1.355.1 → 1.357.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/README.md +2 -9
- package/TrustchexSDK.podspec +5 -4
- package/android/build.gradle +6 -4
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +45 -25
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraManager.kt +168 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +871 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +245 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidationModule.kt +785 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidator.kt +419 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/opencv/OpenCVModule.kt +818 -0
- package/ios/Camera/TrustchexCameraManager.m +37 -0
- package/ios/Camera/TrustchexCameraManager.swift +125 -0
- package/ios/Camera/TrustchexCameraView.swift +1176 -0
- package/ios/MLKit/MLKitModule.m +23 -0
- package/ios/MLKit/MLKitModule.swift +250 -0
- package/ios/MRZValidation.m +39 -0
- package/ios/MRZValidation.swift +802 -0
- package/ios/MRZValidator.swift +466 -0
- package/ios/OpenCV/OpenCVModule.h +4 -0
- package/ios/OpenCV/OpenCVModule.mm +810 -0
- package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +2 -3
- package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +1 -2
- package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +418 -193
- package/lib/module/Screens/Static/OTPVerificationScreen.js +11 -11
- package/lib/module/Screens/Static/QrCodeScanningScreen.js +5 -1
- package/lib/module/Screens/Static/ResultScreen.js +25 -2
- package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +25 -7
- package/lib/module/Shared/Components/DebugNavigationPanel.js +234 -24
- package/lib/module/Shared/Components/EIDScanner.js +99 -9
- package/lib/module/Shared/Components/FaceCamera.js +170 -179
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +2151 -771
- package/lib/module/Shared/Components/QrCodeScannerCamera.js +109 -107
- package/lib/module/Shared/Components/TrustchexCamera.js +122 -0
- package/lib/module/Shared/EIDReader/tlv/tlv.helpers.js +91 -0
- package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +2 -124
- package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +4 -4
- package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +4 -4
- package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +4 -4
- package/lib/module/Shared/Libs/analytics.utils.js +2 -2
- package/lib/module/Shared/Libs/debug.utils.js +132 -0
- package/lib/module/Shared/Libs/deeplink.utils.js +6 -5
- package/lib/module/Shared/Libs/demo.utils.js +13 -3
- package/lib/module/Shared/Libs/mrz.utils.js +1 -175
- package/lib/module/Shared/Libs/native-device-info.utils.js +12 -6
- package/lib/module/Shared/Libs/tts.utils.js +40 -6
- package/lib/module/Shared/Services/AnalyticsService.js +9 -8
- package/lib/module/Shared/Types/mrzFields.js +1 -0
- package/lib/module/Translation/Resources/en.js +87 -88
- package/lib/module/Translation/Resources/tr.js +84 -85
- package/lib/module/Trustchex.js +9 -2
- package/lib/module/index.js +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/OTPVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/DebugNavigationPanel.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +2 -2
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts +18 -4
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +3 -4
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts +2 -1
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +124 -0
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts +11 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts +2 -39
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/analytics.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/debug.utils.d.ts +42 -0
- package/lib/typescript/src/Shared/Libs/debug.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +0 -4
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/tts.utils.d.ts +4 -3
- package/lib/typescript/src/Shared/Libs/tts.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Services/AnalyticsService.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +2 -2
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/mrzFields.d.ts +11 -0
- package/lib/typescript/src/Shared/Types/mrzFields.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts +4 -5
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +4 -5
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
- package/lib/typescript/src/Trustchex.d.ts +2 -0
- package/lib/typescript/src/Trustchex.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +4 -35
- package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +1 -1
- package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +7 -5
- package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +2 -3
- package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +498 -216
- package/src/Screens/Static/OTPVerificationScreen.tsx +37 -31
- package/src/Screens/Static/QrCodeScanningScreen.tsx +8 -1
- package/src/Screens/Static/ResultScreen.tsx +136 -88
- package/src/Screens/Static/VerificationSessionCheckScreen.tsx +46 -13
- package/src/Shared/Components/DebugNavigationPanel.tsx +290 -34
- package/src/Shared/Components/EIDScanner.tsx +94 -16
- package/src/Shared/Components/FaceCamera.tsx +236 -203
- package/src/Shared/Components/IdentityDocumentCamera.tsx +3073 -1030
- package/src/Shared/Components/QrCodeScannerCamera.tsx +133 -127
- package/src/Shared/Components/TrustchexCamera.tsx +289 -0
- package/src/Shared/Config/camera-enhancement.config.ts +2 -2
- package/src/Shared/EIDReader/tlv/tlv.helpers.ts +96 -0
- package/src/Shared/EIDReader/tlv/tlv.utils.ts +2 -125
- package/src/Shared/EIDReader/tlv/tlvInputStream.ts +4 -4
- package/src/Shared/EIDReader/tlv/tlvOutputState.ts +4 -4
- package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +4 -4
- package/src/Shared/Libs/analytics.utils.ts +48 -20
- package/src/Shared/Libs/debug.utils.ts +149 -0
- package/src/Shared/Libs/deeplink.utils.ts +7 -5
- package/src/Shared/Libs/demo.utils.ts +4 -0
- package/src/Shared/Libs/http-client.ts +12 -8
- package/src/Shared/Libs/mrz.utils.ts +1 -163
- package/src/Shared/Libs/native-device-info.utils.ts +12 -6
- package/src/Shared/Libs/tts.utils.ts +48 -6
- package/src/Shared/Services/AnalyticsService.ts +69 -24
- package/src/Shared/Types/identificationInfo.ts +2 -2
- package/src/Shared/Types/mrzFields.ts +29 -0
- package/src/Translation/Resources/en.ts +90 -100
- package/src/Translation/Resources/tr.ts +89 -97
- package/src/Translation/index.ts +1 -1
- package/src/Trustchex.tsx +21 -4
- package/src/index.tsx +14 -0
- package/src/version.ts +1 -1
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/barcodescanner/BarcodeScannerFrameProcessorPlugin.kt +0 -301
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/BitmapUtils.kt +0 -205
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/CropperPlugin.kt +0 -72
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/FrameMetadata.kt +0 -4
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/facedetector/FaceDetectorFrameProcessorPlugin.kt +0 -303
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/textrecognition/TextRecognitionFrameProcessorPlugin.kt +0 -115
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin-Bridging-Header.h +0 -9
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.mm +0 -22
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +0 -188
- package/ios/VisionCameraPlugins/Cropper/Cropper-Bridging-Header.h +0 -13
- package/ios/VisionCameraPlugins/Cropper/Cropper.h +0 -20
- package/ios/VisionCameraPlugins/Cropper/Cropper.mm +0 -22
- package/ios/VisionCameraPlugins/Cropper/Cropper.swift +0 -145
- package/ios/VisionCameraPlugins/Cropper/CropperUtils.swift +0 -49
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin-Bridging-Header.h +0 -4
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.mm +0 -22
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.swift +0 -320
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin-Bridging-Header.h +0 -4
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.mm +0 -27
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.swift +0 -144
- package/lib/module/Shared/Libs/camera.utils.js +0 -308
- package/lib/module/Shared/Libs/frame-enhancement.utils.js +0 -133
- package/lib/module/Shared/Libs/opencv.utils.js +0 -21
- package/lib/module/Shared/Libs/worklet.utils.js +0 -68
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.js +0 -46
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.js +0 -35
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +0 -19
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +0 -26
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/types.js +0 -3
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.js +0 -197
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.js +0 -101
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.js +0 -60
- package/lib/module/Shared/VisionCameraPlugins/Cropper/index.js +0 -47
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/Camera.js +0 -42
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/detectFaces.js +0 -35
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/index.js +0 -4
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/types.js +0 -3
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/Camera.js +0 -56
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.js +0 -20
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.js +0 -9
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/index.js +0 -6
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/scanText.js +0 -20
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/translateText.js +0 -19
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/types.js +0 -3
- package/lib/typescript/src/Shared/Libs/camera.utils.d.ts +0 -87
- package/lib/typescript/src/Shared/Libs/camera.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts +0 -25
- package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts +0 -3
- package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts +0 -9
- package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts +0 -13
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts +0 -6
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +0 -12
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts +0 -52
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts +0 -62
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts +0 -34
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts +0 -32
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts +0 -23
- package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts +0 -9
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts +0 -79
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts +0 -6
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts +0 -5
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts +0 -67
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts.map +0 -1
- package/src/Shared/Libs/camera.utils.ts +0 -345
- package/src/Shared/Libs/frame-enhancement.utils.ts +0 -217
- package/src/Shared/Libs/opencv.utils.ts +0 -40
- package/src/Shared/Libs/worklet.utils.ts +0 -72
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.ts +0 -79
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.ts +0 -46
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +0 -60
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +0 -32
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/types.ts +0 -82
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.ts +0 -195
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.ts +0 -135
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.ts +0 -84
- package/src/Shared/VisionCameraPlugins/Cropper/index.ts +0 -78
- package/src/Shared/VisionCameraPlugins/FaceDetector/Camera.tsx +0 -63
- package/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.ts +0 -44
- package/src/Shared/VisionCameraPlugins/FaceDetector/index.ts +0 -3
- package/src/Shared/VisionCameraPlugins/FaceDetector/types.ts +0 -99
- package/src/Shared/VisionCameraPlugins/TextRecognition/Camera.tsx +0 -76
- package/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.ts +0 -18
- package/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.ts +0 -7
- package/src/Shared/VisionCameraPlugins/TextRecognition/index.ts +0 -7
- package/src/Shared/VisionCameraPlugins/TextRecognition/scanText.ts +0 -27
- package/src/Shared/VisionCameraPlugins/TextRecognition/translateText.ts +0 -21
- package/src/Shared/VisionCameraPlugins/TextRecognition/types.ts +0 -141
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useContext,
|
|
3
|
+
import React, { useCallback, useContext, useRef, useState } from 'react';
|
|
4
4
|
import { SafeAreaView, Text, StyleSheet, Alert, View, Image, Dimensions, KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
-
import { useRoute } from '@react-navigation/native';
|
|
6
|
+
import { useRoute, useFocusEffect } from '@react-navigation/native';
|
|
7
7
|
import AppContext from "../../Shared/Contexts/AppContext.js";
|
|
8
8
|
import httpClient, { BadRequestError, NotFoundError, TooManyRequestsError } from "../../Shared/Libs/http-client.js";
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
@@ -48,9 +48,9 @@ const OTPVerificationScreen = () => {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
const apiUrl = `${appContext.baseUrl}/api/app/mobile`;
|
|
51
|
-
const sendVerificationCode = useCallback(async
|
|
51
|
+
const sendVerificationCode = useCallback(async id => {
|
|
52
52
|
try {
|
|
53
|
-
await httpClient.post(`${apiUrl}/verification-sessions/${
|
|
53
|
+
await httpClient.post(`${apiUrl}/verification-sessions/${id}`, {}, appContext.isDemoSession ? getSimulatedDemoData('SEND_VERIFICATION_CODE') : undefined);
|
|
54
54
|
return true;
|
|
55
55
|
} catch (error) {
|
|
56
56
|
if (error instanceof NotFoundError) {
|
|
@@ -67,9 +67,9 @@ const OTPVerificationScreen = () => {
|
|
|
67
67
|
}
|
|
68
68
|
return false;
|
|
69
69
|
}, [apiUrl, appContext.isDemoSession, t]);
|
|
70
|
-
const getVerifiedSession = useCallback(async (
|
|
70
|
+
const getVerifiedSession = useCallback(async (id, verificationCode) => {
|
|
71
71
|
try {
|
|
72
|
-
const response = await httpClient.post(`${apiUrl}/verification-sessions/${
|
|
72
|
+
const response = await httpClient.post(`${apiUrl}/verification-sessions/${id}`, {
|
|
73
73
|
code: verificationCode
|
|
74
74
|
}, appContext.isDemoSession ? getSimulatedDemoData('GET_VERIFIED_SESSION', {
|
|
75
75
|
code: verificationCode
|
|
@@ -88,11 +88,11 @@ const OTPVerificationScreen = () => {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}, [apiUrl, appContext.isDemoSession, t]);
|
|
91
|
-
const sendOTPCode = useCallback(async
|
|
92
|
-
if (!
|
|
91
|
+
const sendOTPCode = useCallback(async id => {
|
|
92
|
+
if (!id) {
|
|
93
93
|
return false;
|
|
94
94
|
}
|
|
95
|
-
const isSent = await sendVerificationCode(
|
|
95
|
+
const isSent = await sendVerificationCode(id);
|
|
96
96
|
if (!isSent) {
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
@@ -102,12 +102,12 @@ const OTPVerificationScreen = () => {
|
|
|
102
102
|
}, 3 * 60 * 1000);
|
|
103
103
|
return true;
|
|
104
104
|
}, [sendVerificationCode]);
|
|
105
|
-
|
|
105
|
+
useFocusEffect(useCallback(() => {
|
|
106
106
|
if (!initialized.current && sessionId) {
|
|
107
107
|
initialized.current = true;
|
|
108
108
|
sendOTPCode(sessionId);
|
|
109
109
|
}
|
|
110
|
-
}, [sessionId, sendOTPCode]);
|
|
110
|
+
}, [sessionId, sendOTPCode]));
|
|
111
111
|
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
112
112
|
style: styles.safeAreaContainer,
|
|
113
113
|
children: /*#__PURE__*/_jsx(KeyboardAvoidingView, {
|
|
@@ -28,10 +28,14 @@ const QrCodeScanningScreen = () => {
|
|
|
28
28
|
navigation.navigate('VerificationSessionCheckScreen');
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
+
const onClose = () => {
|
|
32
|
+
navigation.goBack();
|
|
33
|
+
};
|
|
31
34
|
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
32
35
|
style: styles.container,
|
|
33
36
|
children: /*#__PURE__*/_jsx(QrCodeScannerCamera, {
|
|
34
|
-
onQrCodeScanned: onQrCodeScanned
|
|
37
|
+
onQrCodeScanned: onQrCodeScanned,
|
|
38
|
+
onClose: onClose
|
|
35
39
|
})
|
|
36
40
|
});
|
|
37
41
|
};
|
|
@@ -127,7 +127,6 @@ const ResultScreen = () => {
|
|
|
127
127
|
country: scannedDocument.mrzFields.issuingState,
|
|
128
128
|
barcodeValue: scannedDocument.barcodeValue,
|
|
129
129
|
personalNumber: scannedDocument.mrzFields.personalNumber || scannedDocument.mrzFields.optional1,
|
|
130
|
-
issueDate: mrzUtils.convertMRZDateToISODate(scannedDocument.mrzFields.issueDate),
|
|
131
130
|
birthDate: mrzUtils.convertMRZDateToISODate(scannedDocument.mrzFields.birthDate),
|
|
132
131
|
expiryDate: mrzUtils.convertMRZDateToISODate(scannedDocument.mrzFields.expirationDate),
|
|
133
132
|
dataSource: scannedDocument.dataSource,
|
|
@@ -462,6 +461,15 @@ const ResultScreen = () => {
|
|
|
462
461
|
style: styles.mrzTextValue,
|
|
463
462
|
children: appContext.identificationInfo.scannedDocument.mrzText
|
|
464
463
|
})]
|
|
464
|
+
}), appContext.identificationInfo.scannedDocument.barcodeValue && /*#__PURE__*/_jsxs(View, {
|
|
465
|
+
style: styles.mrzTextContainer,
|
|
466
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
467
|
+
style: styles.mrzTextLabel,
|
|
468
|
+
children: "Barcode Value"
|
|
469
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
470
|
+
style: styles.mrzTextValue,
|
|
471
|
+
children: appContext.identificationInfo.scannedDocument.barcodeValue
|
|
472
|
+
})]
|
|
465
473
|
}), /*#__PURE__*/_jsx(Text, {
|
|
466
474
|
style: styles.sectionText,
|
|
467
475
|
children: t('resultScreen.demoImages')
|
|
@@ -558,7 +566,22 @@ const ResultScreen = () => {
|
|
|
558
566
|
}
|
|
559
567
|
}), /*#__PURE__*/_jsx(Text, {
|
|
560
568
|
style: styles.imageText,
|
|
561
|
-
children:
|
|
569
|
+
children: (() => {
|
|
570
|
+
switch (instruction.instruction) {
|
|
571
|
+
case 'SMILE':
|
|
572
|
+
return t('livenessDetectionScreen.smile');
|
|
573
|
+
case 'LOOK_STRAIGHT_AND_BLINK':
|
|
574
|
+
return t('livenessDetectionScreen.lookStraightAndBlink');
|
|
575
|
+
case 'TURN_HEAD_LEFT':
|
|
576
|
+
return t('livenessDetectionScreen.turnHeadLeft');
|
|
577
|
+
case 'TURN_HEAD_RIGHT':
|
|
578
|
+
return t('livenessDetectionScreen.turnHeadRight');
|
|
579
|
+
case 'LOOK_UP':
|
|
580
|
+
return t('livenessDetectionScreen.lookUp');
|
|
581
|
+
default:
|
|
582
|
+
return instruction.instruction;
|
|
583
|
+
}
|
|
584
|
+
})()
|
|
562
585
|
})]
|
|
563
586
|
}, index))
|
|
564
587
|
})
|
|
@@ -14,7 +14,7 @@ import { analyticsService } from "../../Shared/Services/AnalyticsService.js";
|
|
|
14
14
|
import { useTheme } from "../../Shared/Contexts/ThemeContext.js";
|
|
15
15
|
import LottieView from 'lottie-react-native';
|
|
16
16
|
import { getSimulatedDemoData, isDemoSession } from "../../Shared/Libs/demo.utils.js";
|
|
17
|
-
import { useNavigation } from '@react-navigation/native';
|
|
17
|
+
import { useNavigation, useFocusEffect } from '@react-navigation/native';
|
|
18
18
|
import { SESSION_CODE_CHARSET_PATTERN, SESSION_CODE_VALIDATION_PATTERN } from "../../Shared/Constants/validation.constants.js";
|
|
19
19
|
import { trackError, trackFunnelStep, useScreenTracking } from "../../Shared/Libs/analytics.utils.js";
|
|
20
20
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -86,6 +86,14 @@ const VerificationSessionCheckScreen = () => {
|
|
|
86
86
|
sessionId
|
|
87
87
|
});
|
|
88
88
|
}, [navigation]);
|
|
89
|
+
|
|
90
|
+
// Reset initialized flag when screen is focused and sessionId is empty (after reset)
|
|
91
|
+
useFocusEffect(useCallback(() => {
|
|
92
|
+
if (!appContext.identificationInfo.sessionId) {
|
|
93
|
+
initialized.current = false;
|
|
94
|
+
isCheckingSessionRef.current = false;
|
|
95
|
+
}
|
|
96
|
+
}, [appContext.identificationInfo.sessionId]));
|
|
89
97
|
useEffect(() => {
|
|
90
98
|
// Only run this effect if sessionId exists AND we're not currently checking a session
|
|
91
99
|
// This prevents race condition when session code is entered
|
|
@@ -94,15 +102,25 @@ const VerificationSessionCheckScreen = () => {
|
|
|
94
102
|
isCheckingSessionRef.current = true;
|
|
95
103
|
setIsCheckingSession(true);
|
|
96
104
|
getSession(appContext.identificationInfo.sessionId).then(session => {
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
if (!session) {
|
|
106
|
+
// Session not found - clear the sessionId and reset flags to allow retry
|
|
107
|
+
Alert.alert(t('general.error'), t('verificationSessionCheckScreen.noVerificationSessionFound'));
|
|
108
|
+
appContext.identificationInfo.sessionId = '';
|
|
109
|
+
if (appContext.setSessionId) {
|
|
110
|
+
appContext.setSessionId('');
|
|
111
|
+
}
|
|
112
|
+
initialized.current = false;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
appContext.workflowSteps = session.workflowSteps;
|
|
116
|
+
if (session.branding) {
|
|
99
117
|
appContext.branding = appContext.branding || session.branding;
|
|
100
118
|
}
|
|
101
|
-
if (session
|
|
119
|
+
if (session.sendOTP) {
|
|
102
120
|
navigateToOTPScreen(session.id);
|
|
103
121
|
} else {
|
|
104
|
-
if (session
|
|
105
|
-
appContext.identificationInfo.identificationId = session
|
|
122
|
+
if (session.identificationId) {
|
|
123
|
+
appContext.identificationInfo.identificationId = session.identificationId;
|
|
106
124
|
}
|
|
107
125
|
navigationManagerRef.current?.navigateToNextStep();
|
|
108
126
|
}
|
|
@@ -113,7 +131,7 @@ const VerificationSessionCheckScreen = () => {
|
|
|
113
131
|
}, 1000);
|
|
114
132
|
});
|
|
115
133
|
}
|
|
116
|
-
}, [appContext, appContext.identificationInfo.sessionId, getSession, navigateToOTPScreen]);
|
|
134
|
+
}, [appContext, appContext.identificationInfo.sessionId, getSession, navigateToOTPScreen, t]);
|
|
117
135
|
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
118
136
|
style: styles.safeAreaContainer,
|
|
119
137
|
children: /*#__PURE__*/_jsx(KeyboardAvoidingView, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useContext, useState } from 'react';
|
|
4
|
-
import { View, Text, TouchableOpacity, StyleSheet, Platform } from 'react-native';
|
|
4
|
+
import { View, Text, TouchableOpacity, StyleSheet, Platform, Switch } from 'react-native';
|
|
5
5
|
import { useNavigation } from '@react-navigation/native';
|
|
6
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
7
|
import AppContext from "../Contexts/AppContext.js";
|
|
@@ -9,24 +9,28 @@ import { getSimulatedDemoData } from "../Libs/demo.utils.js";
|
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
10
|
// Icon mapping matching Flutter SDK Material Icons
|
|
11
11
|
const ICONS = {
|
|
12
|
-
LOGIN: '
|
|
13
|
-
// Icons.login
|
|
14
|
-
HANDSHAKE: '
|
|
15
|
-
// Icons.handshake
|
|
16
|
-
CREDIT_CARD: '
|
|
17
|
-
// Icons.credit_card
|
|
18
|
-
NFC: '
|
|
19
|
-
// Icons.nfc
|
|
20
|
-
FACE: '
|
|
21
|
-
// Icons.face
|
|
22
|
-
CHECK_CIRCLE: '
|
|
23
|
-
// Icons.check_circle
|
|
12
|
+
LOGIN: '�',
|
|
13
|
+
// Icons.login - Locked with key for session security
|
|
14
|
+
HANDSHAKE: '📝',
|
|
15
|
+
// Icons.handshake - Document for contract signing
|
|
16
|
+
CREDIT_CARD: '🪪',
|
|
17
|
+
// Icons.credit_card - ID card for document scan
|
|
18
|
+
NFC: '💳',
|
|
19
|
+
// Icons.nfc - Contactless card for eID
|
|
20
|
+
FACE: '📸',
|
|
21
|
+
// Icons.face - Camera for face detection
|
|
22
|
+
CHECK_CIRCLE: '📋',
|
|
23
|
+
// Icons.check_circle - Clipboard for results
|
|
24
24
|
BUG_REPORT: '🔧',
|
|
25
|
-
// Icons.bug_report
|
|
26
|
-
PHONE: '
|
|
25
|
+
// Icons.bug_report - Wrench for debugging
|
|
26
|
+
PHONE: '💬' // Icons.phone - Message for OTP code
|
|
27
27
|
};
|
|
28
28
|
const DebugNavigationPanel = () => {
|
|
29
29
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
30
|
+
const [selectedScreen, setSelectedScreen] = useState(null);
|
|
31
|
+
const [voiceGuidanceEnabled, setVoiceGuidanceEnabled] = useState(true);
|
|
32
|
+
const [allowIdCard, setAllowIdCard] = useState(true);
|
|
33
|
+
const [allowPassport, setAllowPassport] = useState(true);
|
|
30
34
|
const navigation = useNavigation();
|
|
31
35
|
const appContext = useContext(AppContext);
|
|
32
36
|
const insets = useSafeAreaInsets();
|
|
@@ -40,6 +44,38 @@ const DebugNavigationPanel = () => {
|
|
|
40
44
|
const demoSession = getSimulatedDemoData('GET_SESSION');
|
|
41
45
|
appContext.workflowSteps = demoSession.workflowSteps;
|
|
42
46
|
}, [appContext]);
|
|
47
|
+
const applyVoiceGuidance = useCallback(enabled => {
|
|
48
|
+
if (!appContext.workflowSteps) return;
|
|
49
|
+
appContext.workflowSteps = appContext.workflowSteps.map(step => ({
|
|
50
|
+
...step,
|
|
51
|
+
data: {
|
|
52
|
+
...step.data,
|
|
53
|
+
voiceGuidanceActive: enabled
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
if (appContext.currentWorkflowStep) {
|
|
57
|
+
appContext.currentWorkflowStep = {
|
|
58
|
+
...appContext.currentWorkflowStep,
|
|
59
|
+
data: {
|
|
60
|
+
...appContext.currentWorkflowStep.data,
|
|
61
|
+
voiceGuidanceActive: enabled
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}, [appContext]);
|
|
66
|
+
const applyDocumentTypes = useCallback((allowId, allowPass) => {
|
|
67
|
+
if (!appContext.currentWorkflowStep) return;
|
|
68
|
+
const allowedTypes = [];
|
|
69
|
+
if (allowId) allowedTypes.push('I');
|
|
70
|
+
if (allowPass) allowedTypes.push('P');
|
|
71
|
+
appContext.currentWorkflowStep = {
|
|
72
|
+
...appContext.currentWorkflowStep,
|
|
73
|
+
data: {
|
|
74
|
+
...appContext.currentWorkflowStep.data,
|
|
75
|
+
allowedDocumentTypes: allowedTypes.length === 2 ? null : allowedTypes
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, [appContext]);
|
|
43
79
|
const screens = [{
|
|
44
80
|
screen: 'VerificationSessionCheckScreen',
|
|
45
81
|
label: 'Session Check',
|
|
@@ -58,6 +94,7 @@ const DebugNavigationPanel = () => {
|
|
|
58
94
|
screen: 'ContractAcceptanceScreen',
|
|
59
95
|
label: 'Consent',
|
|
60
96
|
icon: ICONS.HANDSHAKE,
|
|
97
|
+
hasOptions: true,
|
|
61
98
|
setupDemo: () => {
|
|
62
99
|
setupDemoSession(true);
|
|
63
100
|
// Set current workflow step to contract acceptance so demo contract URLs are loaded
|
|
@@ -70,22 +107,39 @@ const DebugNavigationPanel = () => {
|
|
|
70
107
|
screen: 'IdentityDocumentScanningScreen',
|
|
71
108
|
label: 'ID Scan',
|
|
72
109
|
icon: ICONS.CREDIT_CARD,
|
|
110
|
+
hasOptions: true,
|
|
111
|
+
hasDocumentTypeOption: true,
|
|
73
112
|
setupDemo: () => {
|
|
74
113
|
setupDemoSession(true);
|
|
114
|
+
const step = appContext.workflowSteps?.find(s => s.type === 'IDENTITY_DOCUMENT_SCAN');
|
|
115
|
+
if (step) {
|
|
116
|
+
appContext.currentWorkflowStep = step;
|
|
117
|
+
}
|
|
75
118
|
}
|
|
76
119
|
}, {
|
|
77
120
|
screen: 'IdentityDocumentEIDScanningScreen',
|
|
78
121
|
label: 'eID Scan',
|
|
79
122
|
icon: ICONS.NFC,
|
|
123
|
+
hasOptions: true,
|
|
124
|
+
hasDocumentTypeOption: true,
|
|
80
125
|
setupDemo: () => {
|
|
81
126
|
setupDemoSession(true);
|
|
127
|
+
const step = appContext.workflowSteps?.find(s => s.type === 'IDENTITY_DOCUMENT_EID_SCAN');
|
|
128
|
+
if (step) {
|
|
129
|
+
appContext.currentWorkflowStep = step;
|
|
130
|
+
}
|
|
82
131
|
}
|
|
83
132
|
}, {
|
|
84
133
|
screen: 'LivenessDetectionScreen',
|
|
85
134
|
label: 'Liveness',
|
|
86
135
|
icon: ICONS.FACE,
|
|
136
|
+
hasOptions: true,
|
|
87
137
|
setupDemo: () => {
|
|
88
138
|
setupDemoSession(true);
|
|
139
|
+
const step = appContext.workflowSteps?.find(s => s.type === 'LIVENESS_CHECK');
|
|
140
|
+
if (step) {
|
|
141
|
+
appContext.currentWorkflowStep = step;
|
|
142
|
+
}
|
|
89
143
|
}
|
|
90
144
|
}, {
|
|
91
145
|
screen: 'ResultScreen',
|
|
@@ -95,13 +149,44 @@ const DebugNavigationPanel = () => {
|
|
|
95
149
|
setupDemoSession();
|
|
96
150
|
}
|
|
97
151
|
}];
|
|
98
|
-
const
|
|
99
|
-
if (screen.
|
|
100
|
-
screen.setupDemo
|
|
152
|
+
const selectScreen = useCallback(screen => {
|
|
153
|
+
if (!screen.hasOptions) {
|
|
154
|
+
if (screen.setupDemo) {
|
|
155
|
+
screen.setupDemo();
|
|
156
|
+
}
|
|
157
|
+
navigation.navigate(screen.screen, screen.params);
|
|
158
|
+
setIsExpanded(false);
|
|
159
|
+
return;
|
|
101
160
|
}
|
|
102
|
-
|
|
103
|
-
|
|
161
|
+
setSelectedScreen(screen);
|
|
162
|
+
setVoiceGuidanceEnabled(true);
|
|
163
|
+
setAllowIdCard(true);
|
|
164
|
+
setAllowPassport(true);
|
|
104
165
|
}, [navigation]);
|
|
166
|
+
const jumpToScreen = useCallback(() => {
|
|
167
|
+
if (!selectedScreen) return;
|
|
168
|
+
|
|
169
|
+
// Validate document type selection for document scanning screens
|
|
170
|
+
if (selectedScreen.hasDocumentTypeOption && !allowIdCard && !allowPassport) {
|
|
171
|
+
// Don't navigate if no document types are selected
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (selectedScreen.setupDemo) {
|
|
175
|
+
selectedScreen.setupDemo();
|
|
176
|
+
}
|
|
177
|
+
// Apply voice guidance AFTER setupDemo to avoid overwriting
|
|
178
|
+
applyVoiceGuidance(voiceGuidanceEnabled);
|
|
179
|
+
// Apply document types if it's a document scanning screen
|
|
180
|
+
if (selectedScreen.hasDocumentTypeOption) {
|
|
181
|
+
applyDocumentTypes(allowIdCard, allowPassport);
|
|
182
|
+
}
|
|
183
|
+
navigation.navigate(selectedScreen.screen, selectedScreen.params);
|
|
184
|
+
setIsExpanded(false);
|
|
185
|
+
setSelectedScreen(null);
|
|
186
|
+
setVoiceGuidanceEnabled(true);
|
|
187
|
+
setAllowIdCard(true);
|
|
188
|
+
setAllowPassport(true);
|
|
189
|
+
}, [navigation, selectedScreen, voiceGuidanceEnabled, allowIdCard, allowPassport, applyVoiceGuidance, applyDocumentTypes]);
|
|
105
190
|
|
|
106
191
|
// Only show in development mode
|
|
107
192
|
if (!__DEV__) {
|
|
@@ -116,9 +201,76 @@ const DebugNavigationPanel = () => {
|
|
|
116
201
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
117
202
|
style: styles.title,
|
|
118
203
|
children: "SDK JUMP TO SCREEN:"
|
|
119
|
-
}),
|
|
204
|
+
}), selectedScreen ? /*#__PURE__*/_jsxs(View, {
|
|
205
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
206
|
+
style: styles.optionsTitle,
|
|
207
|
+
children: [selectedScreen.icon, " ", selectedScreen.label]
|
|
208
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
209
|
+
style: styles.optionRow,
|
|
210
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
211
|
+
style: styles.optionLabel,
|
|
212
|
+
children: "\uD83D\uDD0A Voice Guidance"
|
|
213
|
+
}), /*#__PURE__*/_jsx(Switch, {
|
|
214
|
+
value: voiceGuidanceEnabled,
|
|
215
|
+
onValueChange: setVoiceGuidanceEnabled,
|
|
216
|
+
trackColor: {
|
|
217
|
+
false: '#616161',
|
|
218
|
+
true: '#FF5252'
|
|
219
|
+
},
|
|
220
|
+
thumbColor: "white"
|
|
221
|
+
})]
|
|
222
|
+
}), selectedScreen.hasDocumentTypeOption && /*#__PURE__*/_jsxs(_Fragment, {
|
|
223
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
224
|
+
style: styles.optionRow,
|
|
225
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
226
|
+
style: styles.optionLabel,
|
|
227
|
+
children: "\uD83E\uDEAA Allow ID Card"
|
|
228
|
+
}), /*#__PURE__*/_jsx(Switch, {
|
|
229
|
+
value: allowIdCard,
|
|
230
|
+
onValueChange: setAllowIdCard,
|
|
231
|
+
trackColor: {
|
|
232
|
+
false: '#616161',
|
|
233
|
+
true: '#FF5252'
|
|
234
|
+
},
|
|
235
|
+
thumbColor: "white"
|
|
236
|
+
})]
|
|
237
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
238
|
+
style: styles.optionRow,
|
|
239
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
240
|
+
style: styles.optionLabel,
|
|
241
|
+
children: "\uD83D\uDEC2 Allow Passport"
|
|
242
|
+
}), /*#__PURE__*/_jsx(Switch, {
|
|
243
|
+
value: allowPassport,
|
|
244
|
+
onValueChange: setAllowPassport,
|
|
245
|
+
trackColor: {
|
|
246
|
+
false: '#616161',
|
|
247
|
+
true: '#FF5252'
|
|
248
|
+
},
|
|
249
|
+
thumbColor: "white"
|
|
250
|
+
})]
|
|
251
|
+
})]
|
|
252
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
253
|
+
style: styles.actionRow,
|
|
254
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
255
|
+
style: styles.backButton,
|
|
256
|
+
onPress: () => setSelectedScreen(null),
|
|
257
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
258
|
+
style: styles.backButtonText,
|
|
259
|
+
children: "\u25C0 Back"
|
|
260
|
+
})
|
|
261
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
262
|
+
style: [styles.goButton, selectedScreen.hasDocumentTypeOption && !allowIdCard && !allowPassport && styles.goButtonDisabled],
|
|
263
|
+
onPress: jumpToScreen,
|
|
264
|
+
disabled: selectedScreen.hasDocumentTypeOption && !allowIdCard && !allowPassport,
|
|
265
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
266
|
+
style: [styles.goButtonText, selectedScreen.hasDocumentTypeOption && !allowIdCard && !allowPassport && styles.goButtonTextDisabled],
|
|
267
|
+
children: "Go \u25B6"
|
|
268
|
+
})
|
|
269
|
+
})]
|
|
270
|
+
})]
|
|
271
|
+
}) : screens.map(screen => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
120
272
|
style: styles.screenButton,
|
|
121
|
-
onPress: () =>
|
|
273
|
+
onPress: () => selectScreen(screen),
|
|
122
274
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
123
275
|
style: styles.screenIcon,
|
|
124
276
|
children: screen.icon
|
|
@@ -129,7 +281,13 @@ const DebugNavigationPanel = () => {
|
|
|
129
281
|
}, screen.screen))]
|
|
130
282
|
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
131
283
|
style: styles.toggleButton,
|
|
132
|
-
onPress: () =>
|
|
284
|
+
onPress: () => {
|
|
285
|
+
setIsExpanded(!isExpanded);
|
|
286
|
+
setSelectedScreen(null);
|
|
287
|
+
setVoiceGuidanceEnabled(true);
|
|
288
|
+
setAllowIdCard(true);
|
|
289
|
+
setAllowPassport(true);
|
|
290
|
+
},
|
|
133
291
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
134
292
|
style: styles.bugIcon,
|
|
135
293
|
children: ICONS.BUG_REPORT
|
|
@@ -202,7 +360,7 @@ const styles = StyleSheet.create({
|
|
|
202
360
|
marginBottom: 10,
|
|
203
361
|
borderWidth: 1,
|
|
204
362
|
borderColor: 'rgba(255, 82, 82, 0.5)',
|
|
205
|
-
minWidth:
|
|
363
|
+
minWidth: 200,
|
|
206
364
|
...Platform.select({
|
|
207
365
|
ios: {
|
|
208
366
|
shadowColor: '#000',
|
|
@@ -247,6 +405,58 @@ const styles = StyleSheet.create({
|
|
|
247
405
|
fontSize: 12,
|
|
248
406
|
fontWeight: '500',
|
|
249
407
|
flex: 1
|
|
408
|
+
},
|
|
409
|
+
optionsTitle: {
|
|
410
|
+
color: 'white',
|
|
411
|
+
fontSize: 14,
|
|
412
|
+
fontWeight: 'bold',
|
|
413
|
+
marginBottom: 12
|
|
414
|
+
},
|
|
415
|
+
optionRow: {
|
|
416
|
+
flexDirection: 'row',
|
|
417
|
+
alignItems: 'center',
|
|
418
|
+
justifyContent: 'space-between',
|
|
419
|
+
paddingVertical: 6,
|
|
420
|
+
marginBottom: 12
|
|
421
|
+
},
|
|
422
|
+
optionLabel: {
|
|
423
|
+
color: 'white',
|
|
424
|
+
fontSize: 13
|
|
425
|
+
},
|
|
426
|
+
actionRow: {
|
|
427
|
+
flexDirection: 'row',
|
|
428
|
+
gap: 8
|
|
429
|
+
},
|
|
430
|
+
backButton: {
|
|
431
|
+
flex: 1,
|
|
432
|
+
backgroundColor: '#616161',
|
|
433
|
+
paddingVertical: 8,
|
|
434
|
+
borderRadius: 4,
|
|
435
|
+
alignItems: 'center'
|
|
436
|
+
},
|
|
437
|
+
backButtonText: {
|
|
438
|
+
color: 'white',
|
|
439
|
+
fontSize: 12,
|
|
440
|
+
fontWeight: '500'
|
|
441
|
+
},
|
|
442
|
+
goButton: {
|
|
443
|
+
flex: 1,
|
|
444
|
+
backgroundColor: '#FF5252',
|
|
445
|
+
paddingVertical: 8,
|
|
446
|
+
borderRadius: 4,
|
|
447
|
+
alignItems: 'center'
|
|
448
|
+
},
|
|
449
|
+
goButtonDisabled: {
|
|
450
|
+
backgroundColor: '#9E9E9E',
|
|
451
|
+
opacity: 0.5
|
|
452
|
+
},
|
|
453
|
+
goButtonText: {
|
|
454
|
+
color: 'white',
|
|
455
|
+
fontSize: 12,
|
|
456
|
+
fontWeight: 'bold'
|
|
457
|
+
},
|
|
458
|
+
goButtonTextDisabled: {
|
|
459
|
+
color: '#CCCCCC'
|
|
250
460
|
}
|
|
251
461
|
});
|
|
252
462
|
export default DebugNavigationPanel;
|