@ha_tecno/live-id-sdk 1.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/build.gradle +4 -0
- package/lib/commonjs/components/{WaitingForResult → CameraConfigInfo}/index.js +9 -11
- package/lib/commonjs/components/CameraConfigInfo/index.js.map +1 -0
- package/lib/commonjs/components/CameraConfigInfo/styles.js +20 -0
- package/lib/commonjs/components/CameraConfigInfo/styles.js.map +1 -0
- package/lib/commonjs/components/CaptureButton/index.js +88 -0
- package/lib/commonjs/components/CaptureButton/index.js.map +1 -0
- package/lib/commonjs/components/CaptureButton/styles.js +22 -0
- package/lib/commonjs/components/CaptureButton/styles.js.map +1 -0
- package/lib/commonjs/components/Gabarito/index.js +2 -2
- package/lib/commonjs/components/Gabarito/index.js.map +1 -1
- package/lib/commonjs/components/Gabarito/styles.js +10 -11
- package/lib/commonjs/components/Gabarito/styles.js.map +1 -1
- package/lib/commonjs/components/HelpRegister/index.js +51 -0
- package/lib/commonjs/components/HelpRegister/index.js.map +1 -0
- package/lib/commonjs/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/styles.js +17 -20
- package/lib/commonjs/components/HelpRegister/styles.js.map +1 -0
- package/lib/commonjs/components/Toast/Toast.js +12 -12
- package/lib/commonjs/components/Toast/Toast.js.map +1 -1
- package/lib/commonjs/components/deviceNotFound/deviceNotFound.js +27 -0
- package/lib/commonjs/components/deviceNotFound/deviceNotFound.js.map +1 -0
- package/lib/commonjs/components/deviceNotFound/styles.js +36 -0
- package/lib/commonjs/components/deviceNotFound/styles.js.map +1 -0
- package/lib/commonjs/components/icon/icon.js +22 -0
- package/lib/commonjs/components/icon/icon.js.map +1 -0
- package/lib/commonjs/components/index.js +56 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/components/modalMessage/modalMessage.js +63 -0
- package/lib/commonjs/components/modalMessage/modalMessage.js.map +1 -0
- package/lib/commonjs/components/modalMessage/styles.js +51 -0
- package/lib/commonjs/components/modalMessage/styles.js.map +1 -0
- package/lib/commonjs/components/recordButton/recordButton.js +83 -0
- package/lib/commonjs/components/recordButton/recordButton.js.map +1 -0
- package/lib/commonjs/components/recordButton/styles.js +21 -0
- package/lib/commonjs/components/recordButton/styles.js.map +1 -0
- package/lib/commonjs/index.js +9 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js +29 -29
- package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js.map +1 -1
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js +128 -0
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js.map +1 -0
- package/lib/commonjs/screens/FingerAuth/styles.js +35 -0
- package/lib/commonjs/screens/FingerAuth/styles.js.map +1 -0
- package/lib/commonjs/screens/FingerRegister/index.js +138 -0
- package/lib/commonjs/screens/FingerRegister/index.js.map +1 -0
- package/lib/commonjs/screens/FingerRegister/styles.js +35 -0
- package/lib/commonjs/screens/FingerRegister/styles.js.map +1 -0
- package/lib/commonjs/screens/LifeCertificate/index.js +145 -0
- package/lib/commonjs/screens/LifeCertificate/index.js.map +1 -0
- package/lib/commonjs/screens/LifeCertificate/styles.js +27 -0
- package/lib/commonjs/screens/LifeCertificate/styles.js.map +1 -0
- package/lib/commonjs/screens/index.js +28 -0
- package/lib/commonjs/screens/index.js.map +1 -0
- package/lib/commonjs/services/index.js +35 -101
- package/lib/commonjs/services/index.js.map +1 -1
- package/lib/commonjs/services/services.js +134 -0
- package/lib/commonjs/services/services.js.map +1 -0
- package/lib/commonjs/services/types.js +2 -0
- package/lib/commonjs/{types/screen.js.map → services/types.js.map} +1 -1
- package/lib/commonjs/store/createSelectors.js +16 -0
- package/lib/commonjs/store/createSelectors.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/index.js +19 -0
- package/lib/commonjs/store/modules/fingerAuth/index.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/selectors.js +13 -0
- package/lib/commonjs/store/modules/fingerAuth/selectors.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/slice.js +92 -0
- package/lib/commonjs/store/modules/fingerAuth/slice.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/type.js +2 -0
- package/lib/commonjs/store/modules/fingerAuth/type.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/index.js +19 -0
- package/lib/commonjs/store/modules/fingerRegister/index.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/selectors.js +13 -0
- package/lib/commonjs/store/modules/fingerRegister/selectors.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/slice.js +101 -0
- package/lib/commonjs/store/modules/fingerRegister/slice.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/types.js +2 -0
- package/lib/commonjs/store/modules/fingerRegister/types.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/index.js +19 -0
- package/lib/commonjs/store/modules/lifeCertificate/index.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/selectors.js +13 -0
- package/lib/commonjs/store/modules/lifeCertificate/selectors.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/slice.js +101 -0
- package/lib/commonjs/store/modules/lifeCertificate/slice.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/types.js +6 -0
- package/lib/commonjs/store/modules/lifeCertificate/types.js.map +1 -0
- package/lib/commonjs/utils/file.js +2 -2
- package/lib/commonjs/utils/getConfigCamera.js +1 -1
- package/lib/commonjs/utils/getConfigCamera.js.map +1 -1
- package/lib/module/components/CameraConfigInfo/index.js +15 -0
- package/lib/module/components/CameraConfigInfo/index.js.map +1 -0
- package/lib/module/components/CameraConfigInfo/styles.js +14 -0
- package/lib/module/components/CameraConfigInfo/styles.js.map +1 -0
- package/lib/module/components/CaptureButton/index.js +79 -0
- package/lib/module/components/CaptureButton/index.js.map +1 -0
- package/lib/module/components/CaptureButton/styles.js +16 -0
- package/lib/module/components/CaptureButton/styles.js.map +1 -0
- package/lib/module/components/Gabarito/index.js +5 -4
- package/lib/module/components/Gabarito/index.js.map +1 -1
- package/lib/module/components/Gabarito/styles.js +11 -12
- package/lib/module/components/Gabarito/styles.js.map +1 -1
- package/lib/module/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/index.js +17 -15
- package/lib/module/components/HelpRegister/index.js.map +1 -0
- package/lib/module/components/HelpRegister/styles.js +53 -0
- package/lib/module/components/HelpRegister/styles.js.map +1 -0
- package/lib/module/components/Toast/Toast.js +14 -14
- package/lib/module/components/Toast/Toast.js.map +1 -1
- package/lib/module/components/deviceNotFound/deviceNotFound.js +20 -0
- package/lib/module/components/deviceNotFound/deviceNotFound.js.map +1 -0
- package/lib/module/components/deviceNotFound/styles.js +30 -0
- package/lib/module/components/deviceNotFound/styles.js.map +1 -0
- package/lib/module/components/icon/icon.js +15 -0
- package/lib/module/components/icon/icon.js.map +1 -0
- package/lib/module/components/index.js +9 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/modalMessage/modalMessage.js +54 -0
- package/lib/module/components/modalMessage/modalMessage.js.map +1 -0
- package/lib/module/components/modalMessage/styles.js +45 -0
- package/lib/module/components/modalMessage/styles.js.map +1 -0
- package/lib/module/components/recordButton/recordButton.js +74 -0
- package/lib/module/components/recordButton/recordButton.js.map +1 -0
- package/lib/module/components/recordButton/styles.js +15 -0
- package/lib/module/components/recordButton/styles.js.map +1 -0
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/CadastroScreen/CadastroScreen.js +33 -33
- package/lib/module/screens/CadastroScreen/CadastroScreen.js.map +1 -1
- package/lib/module/screens/FingerAuth/FingerAuth.js +119 -0
- package/lib/module/screens/FingerAuth/FingerAuth.js.map +1 -0
- package/lib/module/screens/FingerAuth/styles.js +29 -0
- package/lib/module/screens/FingerAuth/styles.js.map +1 -0
- package/lib/module/screens/FingerRegister/index.js +129 -0
- package/lib/module/screens/FingerRegister/index.js.map +1 -0
- package/lib/module/screens/FingerRegister/styles.js +29 -0
- package/lib/module/screens/FingerRegister/styles.js.map +1 -0
- package/lib/module/screens/LifeCertificate/index.js +136 -0
- package/lib/module/screens/LifeCertificate/index.js.map +1 -0
- package/lib/module/screens/LifeCertificate/styles.js +21 -0
- package/lib/module/screens/LifeCertificate/styles.js.map +1 -0
- package/lib/module/screens/index.js +5 -0
- package/lib/module/screens/index.js.map +1 -0
- package/lib/module/services/index.js +9 -95
- package/lib/module/services/index.js.map +1 -1
- package/lib/module/services/services.js +123 -0
- package/lib/module/services/services.js.map +1 -0
- package/lib/module/services/types.js +2 -0
- package/lib/module/{types/screen.js.map → services/types.js.map} +1 -1
- package/lib/module/store/createSelectors.js +10 -0
- package/lib/module/store/createSelectors.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/index.js +3 -0
- package/lib/module/store/modules/fingerAuth/index.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/selectors.js +6 -0
- package/lib/module/store/modules/fingerAuth/selectors.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/slice.js +86 -0
- package/lib/module/store/modules/fingerAuth/slice.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/type.js +2 -0
- package/lib/module/store/modules/fingerAuth/type.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/index.js +3 -0
- package/lib/module/store/modules/fingerRegister/index.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/selectors.js +6 -0
- package/lib/module/store/modules/fingerRegister/selectors.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/slice.js +95 -0
- package/lib/module/store/modules/fingerRegister/slice.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/types.js +2 -0
- package/lib/module/store/modules/fingerRegister/types.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/index.js +3 -0
- package/lib/module/store/modules/lifeCertificate/index.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/selectors.js +6 -0
- package/lib/module/store/modules/lifeCertificate/selectors.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/slice.js +95 -0
- package/lib/module/store/modules/lifeCertificate/slice.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/types.js +2 -0
- package/lib/module/store/modules/lifeCertificate/types.js.map +1 -0
- package/lib/module/utils/file.js +3 -3
- package/lib/module/utils/getConfigCamera.js +4 -4
- package/lib/module/utils/getConfigCamera.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/typescript/src/components/CameraConfigInfo/index.d.ts +8 -0
- package/lib/typescript/src/components/CameraConfigInfo/index.d.ts.map +1 -0
- package/lib/typescript/src/components/CameraConfigInfo/styles.d.ts +13 -0
- package/lib/typescript/src/components/CameraConfigInfo/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/CaptureButton/index.d.ts +10 -0
- package/lib/typescript/src/components/CaptureButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/CaptureButton/styles.d.ts +15 -0
- package/lib/typescript/src/components/CaptureButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Gabarito/index.d.ts +2 -1
- package/lib/typescript/src/components/Gabarito/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Gabarito/styles.d.ts +1 -2
- package/lib/typescript/src/components/Gabarito/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/HelpRegister/index.d.ts +4 -0
- package/lib/typescript/src/components/HelpRegister/index.d.ts.map +1 -0
- package/lib/typescript/src/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/styles.d.ts +2 -5
- package/lib/typescript/src/components/HelpRegister/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Toast/Toast.d.ts +1 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts +8 -0
- package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts.map +1 -0
- package/lib/typescript/src/components/deviceNotFound/styles.d.ts +29 -0
- package/lib/typescript/src/components/deviceNotFound/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/icon/icon.d.ts +9 -0
- package/lib/typescript/src/components/icon/icon.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +9 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/modalMessage/modalMessage.d.ts +11 -0
- package/lib/typescript/src/components/modalMessage/modalMessage.d.ts.map +1 -0
- package/lib/typescript/src/components/modalMessage/styles.d.ts +44 -0
- package/lib/typescript/src/components/modalMessage/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/recordButton/recordButton.d.ts +10 -0
- package/lib/typescript/src/components/recordButton/recordButton.d.ts.map +1 -0
- package/lib/typescript/src/components/recordButton/styles.d.ts +14 -0
- package/lib/typescript/src/components/recordButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts +2 -4
- package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts +9 -0
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts.map +1 -0
- package/lib/typescript/src/screens/FingerAuth/styles.d.ts +25 -0
- package/lib/typescript/src/screens/FingerAuth/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/FingerRegister/index.d.ts +9 -0
- package/lib/typescript/src/screens/FingerRegister/index.d.ts.map +1 -0
- package/lib/typescript/src/screens/FingerRegister/styles.d.ts +25 -0
- package/lib/typescript/src/screens/FingerRegister/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/LifeCertificate/index.d.ts +7 -0
- package/lib/typescript/src/screens/LifeCertificate/index.d.ts.map +1 -0
- package/lib/typescript/src/{components/WaitingForResult → screens/LifeCertificate}/styles.d.ts +7 -11
- package/lib/typescript/src/screens/LifeCertificate/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/index.d.ts +5 -0
- package/lib/typescript/src/screens/index.d.ts.map +1 -0
- package/lib/typescript/src/services/index.d.ts +2 -17
- package/lib/typescript/src/services/index.d.ts.map +1 -1
- package/lib/typescript/src/services/services.d.ts +6 -0
- package/lib/typescript/src/services/services.d.ts.map +1 -0
- package/lib/typescript/src/services/types.d.ts +37 -0
- package/lib/typescript/src/services/types.d.ts.map +1 -0
- package/lib/typescript/src/store/createSelectors.d.ts +11 -0
- package/lib/typescript/src/store/createSelectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/index.d.ts +3 -0
- package/lib/typescript/src/store/modules/fingerAuth/index.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts +20 -0
- package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts +4 -0
- package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/type.d.ts +28 -0
- package/lib/typescript/src/store/modules/fingerAuth/type.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/index.d.ts +3 -0
- package/lib/typescript/src/store/modules/fingerRegister/index.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts +22 -0
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts +4 -0
- package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts +30 -0
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/index.d.ts +3 -0
- package/lib/typescript/src/store/modules/lifeCertificate/index.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/selectors.d.ts +23 -0
- package/lib/typescript/src/store/modules/lifeCertificate/selectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts +4 -0
- package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts +37 -0
- package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/getConfigCamera.d.ts +1 -1
- package/lib/typescript/src/utils/getConfigCamera.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +1 -1
- package/package.json +24 -42
- package/src/components/CameraConfigInfo/index.tsx +20 -0
- package/src/components/CameraConfigInfo/styles.ts +14 -0
- package/src/components/CaptureButton/index.tsx +74 -0
- package/src/components/CaptureButton/styles.ts +16 -0
- package/src/components/Gabarito/index.tsx +6 -4
- package/src/components/Gabarito/styles.ts +13 -14
- package/src/components/HelpRegister/index.tsx +40 -0
- package/src/components/HelpRegister/styles.ts +54 -0
- package/src/components/Toast/Toast.tsx +18 -22
- package/src/components/deviceNotFound/deviceNotFound.tsx +23 -0
- package/src/components/deviceNotFound/styles.ts +30 -0
- package/src/components/icon/icon.tsx +14 -0
- package/src/components/index.ts +9 -0
- package/src/components/modalMessage/modalMessage.tsx +73 -0
- package/src/components/modalMessage/styles.ts +45 -0
- package/src/components/recordButton/recordButton.tsx +75 -0
- package/src/components/recordButton/styles.ts +15 -0
- package/src/index.tsx +5 -4
- package/src/screens/CadastroScreen/CadastroScreen.tsx +35 -52
- package/src/screens/FingerAuth/FingerAuth.tsx +121 -0
- package/src/screens/FingerAuth/styles.ts +28 -0
- package/src/screens/FingerRegister/index.tsx +141 -0
- package/src/screens/FingerRegister/styles.ts +28 -0
- package/src/screens/LifeCertificate/index.tsx +152 -0
- package/src/screens/LifeCertificate/styles.ts +21 -0
- package/src/screens/index.ts +5 -0
- package/src/services/index.ts +12 -113
- package/src/services/services.ts +129 -0
- package/src/services/types.ts +42 -0
- package/src/store/createSelectors.ts +15 -0
- package/src/store/modules/fingerAuth/index.ts +3 -0
- package/src/store/modules/fingerAuth/selectors.ts +7 -0
- package/src/store/modules/fingerAuth/slice.ts +91 -0
- package/src/store/modules/fingerAuth/type.ts +29 -0
- package/src/store/modules/fingerRegister/index.ts +3 -0
- package/src/store/modules/fingerRegister/selectors.ts +7 -0
- package/src/store/modules/fingerRegister/slice.ts +101 -0
- package/src/store/modules/fingerRegister/types.ts +30 -0
- package/src/store/modules/lifeCertificate/index.ts +3 -0
- package/src/store/modules/lifeCertificate/selectors.ts +7 -0
- package/src/store/modules/lifeCertificate/slice.ts +100 -0
- package/src/store/modules/lifeCertificate/types.ts +40 -0
- package/src/utils/file.ts +3 -3
- package/src/utils/getConfigCamera.ts +7 -12
- package/src/utils/index.ts +1 -1
- package/lib/commonjs/components/CameraConfigInfos/index.js +0 -21
- package/lib/commonjs/components/CameraConfigInfos/index.js.map +0 -1
- package/lib/commonjs/components/CameraConfigInfos/styles.js +0 -19
- package/lib/commonjs/components/CameraConfigInfos/styles.js.map +0 -1
- package/lib/commonjs/components/DeviceNullDisplay/index.js +0 -59
- package/lib/commonjs/components/DeviceNullDisplay/index.js.map +0 -1
- package/lib/commonjs/components/ErrorDisplay/index.js +0 -59
- package/lib/commonjs/components/ErrorDisplay/index.js.map +0 -1
- package/lib/commonjs/components/WaitingForResult/index.js.map +0 -1
- package/lib/commonjs/components/WaitingForResult/styles.js +0 -32
- package/lib/commonjs/components/WaitingForResult/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js +0 -49
- package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js +0 -298
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js +0 -54
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js +0 -44
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +0 -65
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/index.js +0 -50
- package/lib/commonjs/screens/CadastroFinger/index.js.map +0 -1
- package/lib/commonjs/screens/ProvaVidas/index.js +0 -246
- package/lib/commonjs/screens/ProvaVidas/index.js.map +0 -1
- package/lib/commonjs/screens/ProvaVidas/styles.js +0 -93
- package/lib/commonjs/screens/ProvaVidas/styles.js.map +0 -1
- package/lib/commonjs/screens/ValidadeFinger/index.js +0 -216
- package/lib/commonjs/screens/ValidadeFinger/index.js.map +0 -1
- package/lib/commonjs/screens/ValidadeFinger/styles.js +0 -54
- package/lib/commonjs/screens/ValidadeFinger/styles.js.map +0 -1
- package/lib/commonjs/types/screen.js +0 -2
- package/lib/module/components/CameraConfigInfos/index.js +0 -13
- package/lib/module/components/CameraConfigInfos/index.js.map +0 -1
- package/lib/module/components/CameraConfigInfos/styles.js +0 -13
- package/lib/module/components/CameraConfigInfos/styles.js.map +0 -1
- package/lib/module/components/DeviceNullDisplay/index.js +0 -51
- package/lib/module/components/DeviceNullDisplay/index.js.map +0 -1
- package/lib/module/components/ErrorDisplay/index.js +0 -51
- package/lib/module/components/ErrorDisplay/index.js.map +0 -1
- package/lib/module/components/WaitingForResult/index.js +0 -17
- package/lib/module/components/WaitingForResult/index.js.map +0 -1
- package/lib/module/components/WaitingForResult/styles.js +0 -26
- package/lib/module/components/WaitingForResult/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js +0 -56
- package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js +0 -288
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js +0 -48
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js +0 -36
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +0 -59
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/index.js +0 -42
- package/lib/module/screens/CadastroFinger/index.js.map +0 -1
- package/lib/module/screens/ProvaVidas/index.js +0 -239
- package/lib/module/screens/ProvaVidas/index.js.map +0 -1
- package/lib/module/screens/ProvaVidas/styles.js +0 -87
- package/lib/module/screens/ProvaVidas/styles.js.map +0 -1
- package/lib/module/screens/ValidadeFinger/index.js +0 -206
- package/lib/module/screens/ValidadeFinger/index.js.map +0 -1
- package/lib/module/screens/ValidadeFinger/styles.js +0 -48
- package/lib/module/screens/ValidadeFinger/styles.js.map +0 -1
- package/lib/module/types/screen.js +0 -2
- package/lib/typescript/src/components/CameraConfigInfos/index.d.ts +0 -9
- package/lib/typescript/src/components/CameraConfigInfos/index.d.ts.map +0 -1
- package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts +0 -11
- package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts.map +0 -1
- package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts +0 -11
- package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts.map +0 -1
- package/lib/typescript/src/components/ErrorDisplay/index.d.ts +0 -11
- package/lib/typescript/src/components/ErrorDisplay/index.d.ts.map +0 -1
- package/lib/typescript/src/components/WaitingForResult/index.d.ts +0 -7
- package/lib/typescript/src/components/WaitingForResult/index.d.ts.map +0 -1
- package/lib/typescript/src/components/WaitingForResult/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts +0 -7
- package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts +0 -16
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts +0 -44
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts +0 -12
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts +0 -54
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/index.d.ts +0 -16
- package/lib/typescript/src/screens/CadastroFinger/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ProvaVidas/index.d.ts +0 -14
- package/lib/typescript/src/screens/ProvaVidas/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ProvaVidas/styles.d.ts +0 -85
- package/lib/typescript/src/screens/ProvaVidas/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/ValidadeFinger/index.d.ts +0 -14
- package/lib/typescript/src/screens/ValidadeFinger/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts +0 -44
- package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts.map +0 -1
- package/lib/typescript/src/types/screen.d.ts +0 -6
- package/lib/typescript/src/types/screen.d.ts.map +0 -1
- package/live-id-sdk.podspec +0 -41
- package/src/components/CameraConfigInfos/index.tsx +0 -25
- package/src/components/CameraConfigInfos/styles.ts +0 -13
- package/src/components/DeviceNullDisplay/index.tsx +0 -59
- package/src/components/ErrorDisplay/index.tsx +0 -60
- package/src/components/WaitingForResult/index.tsx +0 -22
- package/src/components/WaitingForResult/styles.ts +0 -27
- package/src/screens/CadastroFinger/components/AjudaCadastro/index.tsx +0 -49
- package/src/screens/CadastroFinger/components/AjudaCadastro/styles.ts +0 -56
- package/src/screens/CadastroFinger/components/CameraCadastro/index.tsx +0 -356
- package/src/screens/CadastroFinger/components/CameraCadastro/styles.ts +0 -47
- package/src/screens/CadastroFinger/components/ImageDisplayScreen/index.tsx +0 -45
- package/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.ts +0 -55
- package/src/screens/CadastroFinger/index.tsx +0 -56
- package/src/screens/ProvaVidas/index.tsx +0 -308
- package/src/screens/ProvaVidas/styles.ts +0 -99
- package/src/screens/ValidadeFinger/index.tsx +0 -263
- package/src/screens/ValidadeFinger/styles.ts +0 -47
- package/src/types/screen.ts +0 -5
@@ -0,0 +1,75 @@
|
|
1
|
+
import React, { useEffect } from "react";
|
2
|
+
import { Pressable } from "react-native";
|
3
|
+
import Animated, {
|
4
|
+
interpolateColor,
|
5
|
+
useAnimatedStyle,
|
6
|
+
useSharedValue,
|
7
|
+
withSpring,
|
8
|
+
withTiming
|
9
|
+
} from "react-native-reanimated";
|
10
|
+
import Icon from "../icon/icon";
|
11
|
+
import { styles } from "./styles";
|
12
|
+
|
13
|
+
type Props = {
|
14
|
+
onPress: () => void;
|
15
|
+
disabled: boolean;
|
16
|
+
isRecording: boolean;
|
17
|
+
timer: number;
|
18
|
+
};
|
19
|
+
|
20
|
+
const RecordButton = ({ onPress, disabled, timer, isRecording }: Props) => {
|
21
|
+
const progress = useSharedValue(0);
|
22
|
+
const width = useSharedValue(100);
|
23
|
+
const translateX = useSharedValue(0);
|
24
|
+
const opacity = useSharedValue(0);
|
25
|
+
|
26
|
+
const animatedView = useAnimatedStyle(() => ({
|
27
|
+
width: width.value,
|
28
|
+
backgroundColor: interpolateColor(progress.value, [0, 1], ["#1F75FF", "#DE3737"])
|
29
|
+
}));
|
30
|
+
|
31
|
+
const animatedIcon = useAnimatedStyle(() => ({
|
32
|
+
transform: [{ translateX: -translateX.value }]
|
33
|
+
}));
|
34
|
+
|
35
|
+
const animatedText = useAnimatedStyle(() => ({
|
36
|
+
opacity: opacity.value,
|
37
|
+
transform: [{ translateX: translateX.value }]
|
38
|
+
}));
|
39
|
+
|
40
|
+
useEffect(() => {
|
41
|
+
if (timer === 0) {
|
42
|
+
setTimeout(() => {
|
43
|
+
width.value = withSpring(100);
|
44
|
+
translateX.value = withSpring(0);
|
45
|
+
opacity.value = withTiming(0, { duration: 250 });
|
46
|
+
}, 500);
|
47
|
+
setTimeout(() => {
|
48
|
+
progress.value = withSpring(0, { duration: 1000 });
|
49
|
+
}, 5);
|
50
|
+
}
|
51
|
+
}, [width, opacity, timer, progress, translateX]);
|
52
|
+
|
53
|
+
const handlePress = () => {
|
54
|
+
onPress();
|
55
|
+
width.value = withSpring(175);
|
56
|
+
translateX.value = withSpring(25);
|
57
|
+
opacity.value = withTiming(1, { duration: 250 });
|
58
|
+
progress.value = withSpring(1, { duration: 1000 });
|
59
|
+
};
|
60
|
+
|
61
|
+
return (
|
62
|
+
<Pressable onPress={handlePress} disabled={disabled}>
|
63
|
+
<Animated.View style={[styles.container, animatedView]}>
|
64
|
+
<Animated.View style={animatedIcon}>
|
65
|
+
<Icon name="videocam-outline" size={40} color="white" />
|
66
|
+
</Animated.View>
|
67
|
+
{isRecording && timer >= 0 ? (
|
68
|
+
<Animated.Text style={[styles.text, animatedText]}>{timer}</Animated.Text>
|
69
|
+
) : undefined}
|
70
|
+
</Animated.View>
|
71
|
+
</Pressable>
|
72
|
+
);
|
73
|
+
};
|
74
|
+
|
75
|
+
export default RecordButton;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { StyleSheet } from "react-native";
|
2
|
+
|
3
|
+
export const styles = StyleSheet.create({
|
4
|
+
container: {
|
5
|
+
flexDirection: "row",
|
6
|
+
height: 50,
|
7
|
+
justifyContent: "center",
|
8
|
+
alignItems: "center",
|
9
|
+
borderRadius: 50,
|
10
|
+
},
|
11
|
+
text: {
|
12
|
+
position: "absolute",
|
13
|
+
color: "#fff",
|
14
|
+
},
|
15
|
+
});
|
package/src/index.tsx
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
1
|
+
import { LifeCertificate, FingerRegister, FingerAuth } from "./screens";
|
2
2
|
|
3
3
|
// deprecated
|
4
|
-
|
5
|
-
export {
|
6
|
-
|
4
|
+
|
5
|
+
export { CadastroScreen } from "./screens/CadastroScreen/CadastroScreen";
|
6
|
+
|
7
|
+
export { LifeCertificate, FingerRegister, FingerAuth };
|
@@ -1,18 +1,8 @@
|
|
1
1
|
/* eslint-disable react-native/no-inline-styles */
|
2
|
-
import React, { useEffect, useState } from
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
TextInput,
|
7
|
-
TouchableOpacity,
|
8
|
-
StyleSheet,
|
9
|
-
Alert,
|
10
|
-
Image,
|
11
|
-
} from 'react-native';
|
12
|
-
import { cadastro } from '../../services';
|
13
|
-
import Modal, { type ModalProps } from 'react-native-modal';
|
14
|
-
|
15
|
-
import type { ScreenProps } from '../../types/screen';
|
2
|
+
import React, { useEffect, useState } from "react";
|
3
|
+
import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert, Image } from "react-native";
|
4
|
+
import { cadastro } from "../../services";
|
5
|
+
import Modal, { type ModalProps } from "react-native-modal";
|
16
6
|
|
17
7
|
interface CadastroScreenProps {
|
18
8
|
isVisible: boolean;
|
@@ -20,7 +10,6 @@ interface CadastroScreenProps {
|
|
20
10
|
onError?: (response?: any) => void;
|
21
11
|
onSuccess?: (response?: any) => void;
|
22
12
|
ModalParams?: ModalProps;
|
23
|
-
screenProps?: ScreenProps;
|
24
13
|
}
|
25
14
|
|
26
15
|
export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
@@ -28,15 +17,15 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
28
17
|
onCloseModal,
|
29
18
|
onError,
|
30
19
|
onSuccess,
|
31
|
-
ModalParams
|
20
|
+
ModalParams
|
32
21
|
}) => {
|
33
|
-
const [cpf, setCpf] = useState(
|
34
|
-
const [nome, setNome] = useState(
|
35
|
-
const [senha, setSenha] = useState(
|
36
|
-
const [confirmarSenha, setConfirmarSenha] = useState(
|
22
|
+
const [cpf, setCpf] = useState("");
|
23
|
+
const [nome, setNome] = useState("");
|
24
|
+
const [senha, setSenha] = useState("");
|
25
|
+
const [confirmarSenha, setConfirmarSenha] = useState("");
|
37
26
|
|
38
27
|
const generateRandomElevenDigits = () => {
|
39
|
-
let cpf =
|
28
|
+
let cpf = "";
|
40
29
|
for (let i = 0; i < 11; i++) {
|
41
30
|
cpf += Math.floor(Math.random() * 9);
|
42
31
|
}
|
@@ -45,7 +34,7 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
45
34
|
|
46
35
|
const generateRandomName = () => {
|
47
36
|
// uma strin aleatória de 10 caracteres a 14 caracteres
|
48
|
-
let name =
|
37
|
+
let name = "";
|
49
38
|
const length = Math.floor(Math.random() * 5) + 10;
|
50
39
|
for (let i = 0; i < length; i++) {
|
51
40
|
name += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
|
@@ -60,8 +49,8 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
60
49
|
const generateRnadomUser = () => {
|
61
50
|
setCpf(generateRandomElevenDigits());
|
62
51
|
setNome(generateRandomName());
|
63
|
-
setSenha(
|
64
|
-
setConfirmarSenha(
|
52
|
+
setSenha("123");
|
53
|
+
setConfirmarSenha("123");
|
65
54
|
};
|
66
55
|
|
67
56
|
const handleCadastro = async () => {
|
@@ -74,7 +63,7 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
74
63
|
onSuccess && onSuccess(response);
|
75
64
|
|
76
65
|
onCloseModalHandler();
|
77
|
-
if (jsonString.includes(
|
66
|
+
if (jsonString.includes("person_id")) {
|
78
67
|
if (response.finger === false) {
|
79
68
|
// openModal({
|
80
69
|
// type: 'ajuda',
|
@@ -87,24 +76,18 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
87
76
|
// type: 'login',
|
88
77
|
// });
|
89
78
|
}
|
90
|
-
} else if (jsonString.includes(
|
91
|
-
Alert.alert(
|
79
|
+
} else if (jsonString.includes("User exists")) {
|
80
|
+
Alert.alert("Usuário já cadastrado!");
|
92
81
|
// openModal({
|
93
82
|
// type: 'login',
|
94
83
|
// });
|
95
|
-
} else if (jsonString.includes(
|
96
|
-
Alert.alert(
|
84
|
+
} else if (jsonString.includes("erro")) {
|
85
|
+
Alert.alert("Usuário não cadastrado", "Por favor, cadastre-se!");
|
97
86
|
} else {
|
98
|
-
Alert.alert(
|
99
|
-
'Erro',
|
100
|
-
'Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.'
|
101
|
-
);
|
87
|
+
Alert.alert("Erro", "Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.");
|
102
88
|
}
|
103
89
|
} else {
|
104
|
-
Alert.alert(
|
105
|
-
'Erro',
|
106
|
-
'As senhas não coincidem. Por favor, tente novamente.'
|
107
|
-
);
|
90
|
+
Alert.alert("Erro", "As senhas não coincidem. Por favor, tente novamente.");
|
108
91
|
return;
|
109
92
|
}
|
110
93
|
} catch (error) {
|
@@ -128,7 +111,7 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
128
111
|
{...ModalParams}
|
129
112
|
>
|
130
113
|
<View style={styles.container}>
|
131
|
-
<Image source={require(
|
114
|
+
<Image source={require("../../assets/logo.png")} style={styles.logo} />
|
132
115
|
<Text style={styles.title}>Cadastro de usuário</Text>
|
133
116
|
<TextInput
|
134
117
|
style={styles.input}
|
@@ -172,41 +155,41 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
|
|
172
155
|
const styles = StyleSheet.create({
|
173
156
|
container: {
|
174
157
|
flex: 1,
|
175
|
-
alignItems:
|
176
|
-
justifyContent:
|
177
|
-
backgroundColor:
|
158
|
+
alignItems: "center",
|
159
|
+
justifyContent: "center",
|
160
|
+
backgroundColor: "#fff"
|
178
161
|
},
|
179
162
|
title: {
|
180
163
|
fontSize: 24,
|
181
164
|
marginBottom: 16,
|
182
|
-
color:
|
165
|
+
color: "#00bfff"
|
183
166
|
},
|
184
167
|
input: {
|
185
|
-
width:
|
168
|
+
width: "80%",
|
186
169
|
height: 50,
|
187
170
|
padding: 10,
|
188
171
|
borderWidth: 1,
|
189
|
-
borderColor:
|
172
|
+
borderColor: "#ccc",
|
190
173
|
borderRadius: 4,
|
191
174
|
marginBottom: 16,
|
192
175
|
fontSize: 16,
|
193
|
-
color:
|
176
|
+
color: "#000"
|
194
177
|
},
|
195
178
|
button: {
|
196
|
-
width:
|
179
|
+
width: "80%",
|
197
180
|
height: 50,
|
198
|
-
backgroundColor:
|
181
|
+
backgroundColor: "#00bfff",
|
199
182
|
borderRadius: 4,
|
200
|
-
alignItems:
|
201
|
-
justifyContent:
|
183
|
+
alignItems: "center",
|
184
|
+
justifyContent: "center"
|
202
185
|
},
|
203
186
|
buttonText: {
|
204
187
|
fontSize: 16,
|
205
|
-
color:
|
188
|
+
color: "#fff"
|
206
189
|
},
|
207
190
|
logo: {
|
208
191
|
width: 500,
|
209
192
|
height: 250,
|
210
|
-
resizeMode:
|
211
|
-
}
|
193
|
+
resizeMode: "contain"
|
194
|
+
}
|
212
195
|
});
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
2
|
+
import { View } from "react-native";
|
3
|
+
import { Camera, useCameraFormat, Point, useCameraDevice, useCameraPermission } from "react-native-vision-camera";
|
4
|
+
import Orientation from "react-native-orientation-locker";
|
5
|
+
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
|
6
|
+
import { runOnJS } from "react-native-reanimated";
|
7
|
+
|
8
|
+
import { styles } from "./styles";
|
9
|
+
import { DeviceNotFound, Gabarito, CameraConfigInfo, ModalMessage, CaptureButton } from "../../components";
|
10
|
+
import { useDispatch, useSelector } from "../../store/modules/fingerAuth";
|
11
|
+
|
12
|
+
type Props = {
|
13
|
+
UID: string;
|
14
|
+
qualityPrioritization?: "speed" | "quality" | "balanced";
|
15
|
+
onSuccess: (code: number) => void;
|
16
|
+
};
|
17
|
+
|
18
|
+
const FingerAuth = ({ UID, qualityPrioritization, onSuccess }: Props) => {
|
19
|
+
const cameraRef = useRef<Camera>(null);
|
20
|
+
const { hasPermission, requestPermission } = useCameraPermission();
|
21
|
+
const device = useCameraDevice("back");
|
22
|
+
const dispatch = useDispatch();
|
23
|
+
const state = useSelector();
|
24
|
+
|
25
|
+
useEffect(() => {
|
26
|
+
Orientation.lockToPortrait();
|
27
|
+
return () => {
|
28
|
+
Orientation.unlockAllOrientations();
|
29
|
+
};
|
30
|
+
}, []);
|
31
|
+
|
32
|
+
const cameraPermission = useCallback(async () => {
|
33
|
+
if (!hasPermission) {
|
34
|
+
await requestPermission();
|
35
|
+
}
|
36
|
+
}, [hasPermission, requestPermission]);
|
37
|
+
|
38
|
+
useEffect(() => {
|
39
|
+
cameraPermission();
|
40
|
+
dispatch.getConfig("finger");
|
41
|
+
}, [cameraPermission]);
|
42
|
+
|
43
|
+
const containerCaptureStyled = useMemo(
|
44
|
+
() => [styles.containerCapture, { bottom: state.showButtonInfo ? 75 : 20 }],
|
45
|
+
[state.showButtonInfo]
|
46
|
+
);
|
47
|
+
|
48
|
+
const cameraFormat = useCameraFormat(device, [
|
49
|
+
{
|
50
|
+
photoResolution: {
|
51
|
+
height: 1280,
|
52
|
+
width: 720
|
53
|
+
}
|
54
|
+
}
|
55
|
+
]);
|
56
|
+
|
57
|
+
useEffect(() => {
|
58
|
+
if (state.code === 0) {
|
59
|
+
dispatch.setModal("Sucesso!", "Usuário Identificado!");
|
60
|
+
onSuccess && onSuccess?.(state.code);
|
61
|
+
dispatch.handleLoading();
|
62
|
+
}
|
63
|
+
if (state.code !== 0 && state.code !== null) {
|
64
|
+
dispatch.setModal("Ocorreu um erro!", `Erro: ${state.message}`);
|
65
|
+
dispatch.handleLoading();
|
66
|
+
}
|
67
|
+
dispatch.resetState();
|
68
|
+
}, [state.code, state.message, dispatch.handleLoading, dispatch.resetState, dispatch.setModal]);
|
69
|
+
|
70
|
+
const takePhoto = async () => {
|
71
|
+
const photo = await cameraRef.current?.takePhoto({
|
72
|
+
qualityPrioritization: qualityPrioritization,
|
73
|
+
flash: "on"
|
74
|
+
});
|
75
|
+
if (photo != null) dispatch.sendImage(photo.path, UID);
|
76
|
+
};
|
77
|
+
|
78
|
+
const focus = useCallback((point: Point) => {
|
79
|
+
const camera = cameraRef.current;
|
80
|
+
if (camera != null) {
|
81
|
+
camera.focus(point);
|
82
|
+
}
|
83
|
+
}, []);
|
84
|
+
|
85
|
+
const gesture = Gesture.Tap().onBegin(({ x, y }) => {
|
86
|
+
runOnJS(focus)({ x, y });
|
87
|
+
});
|
88
|
+
|
89
|
+
if (device == null || hasPermission === false)
|
90
|
+
return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
|
91
|
+
|
92
|
+
return (
|
93
|
+
<GestureHandlerRootView style={styles.root}>
|
94
|
+
<GestureDetector gesture={gesture}>
|
95
|
+
<View style={styles.cameraContainer}>
|
96
|
+
<Camera
|
97
|
+
ref={cameraRef}
|
98
|
+
style={styles.camera}
|
99
|
+
isActive={true}
|
100
|
+
device={device}
|
101
|
+
format={cameraFormat}
|
102
|
+
torch={"on"}
|
103
|
+
focusable={true}
|
104
|
+
exposure={state.exposure}
|
105
|
+
zoom={state.exposure}
|
106
|
+
photo={true}
|
107
|
+
enableHighQualityPhotos={true}
|
108
|
+
/>
|
109
|
+
<Gabarito />
|
110
|
+
</View>
|
111
|
+
</GestureDetector>
|
112
|
+
<View style={containerCaptureStyled}>
|
113
|
+
<CaptureButton authFinger onPress={takePhoto} loading={state.loading} />
|
114
|
+
</View>
|
115
|
+
{state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.exposure} />}
|
116
|
+
<ModalMessage isLoading={state.loading} modal={state.modal} />
|
117
|
+
</GestureHandlerRootView>
|
118
|
+
);
|
119
|
+
};
|
120
|
+
|
121
|
+
export default FingerAuth;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { StyleSheet, Dimensions } from "react-native";
|
2
|
+
|
3
|
+
const { height } = Dimensions.get("window");
|
4
|
+
|
5
|
+
export const styles = StyleSheet.create({
|
6
|
+
container: {
|
7
|
+
flex: 1
|
8
|
+
},
|
9
|
+
root: {
|
10
|
+
flex: 1
|
11
|
+
},
|
12
|
+
cameraContainer: {
|
13
|
+
flex: 1,
|
14
|
+
justifyContent: "center"
|
15
|
+
},
|
16
|
+
camera: {
|
17
|
+
flex: 1,
|
18
|
+
paddingBottom: height * 0.2
|
19
|
+
},
|
20
|
+
containerCapture: {
|
21
|
+
position: "absolute",
|
22
|
+
width: "100%",
|
23
|
+
alignItems: "center"
|
24
|
+
},
|
25
|
+
cameraConfigs: {
|
26
|
+
alignItems: "center"
|
27
|
+
}
|
28
|
+
});
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
2
|
+
import { View } from "react-native";
|
3
|
+
import { Camera, useCameraFormat, type Point, useCameraDevice, useCameraPermission } from "react-native-vision-camera";
|
4
|
+
import Orientation from "react-native-orientation-locker";
|
5
|
+
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
|
6
|
+
import { runOnJS } from "react-native-reanimated";
|
7
|
+
|
8
|
+
import { styles } from "./styles";
|
9
|
+
import { useSelector, useDispatch } from "../../store/modules/fingerRegister";
|
10
|
+
import {
|
11
|
+
CaptureButton,
|
12
|
+
DeviceNotFound,
|
13
|
+
HelpRegister,
|
14
|
+
ModalMessage,
|
15
|
+
CameraConfigInfo,
|
16
|
+
Gabarito
|
17
|
+
} from "../../components";
|
18
|
+
|
19
|
+
type Props = {
|
20
|
+
UID: string;
|
21
|
+
qualityPrioritization: "speed" | "quality" | "balanced";
|
22
|
+
onSuccess: (code: number) => void;
|
23
|
+
};
|
24
|
+
|
25
|
+
const FingerRegister = ({ UID, qualityPrioritization, onSuccess }: Props) => {
|
26
|
+
const cameraRef = useRef<Camera>(null);
|
27
|
+
const { hasPermission, requestPermission } = useCameraPermission();
|
28
|
+
const state = useSelector();
|
29
|
+
const dispatch = useDispatch();
|
30
|
+
const device = useCameraDevice("back");
|
31
|
+
const base64ImagesCount = state.base64Images.length;
|
32
|
+
|
33
|
+
useEffect(() => {
|
34
|
+
Orientation.lockToPortrait();
|
35
|
+
return () => {
|
36
|
+
Orientation.unlockAllOrientations();
|
37
|
+
};
|
38
|
+
}, []);
|
39
|
+
|
40
|
+
useEffect(() => {
|
41
|
+
if (state.base64Images !== undefined && base64ImagesCount === 3) {
|
42
|
+
if (!UID) {
|
43
|
+
dispatch.setModal("Ocorreu um erro!", "Erro: UID não encontrado!");
|
44
|
+
}
|
45
|
+
dispatch.handleLoading();
|
46
|
+
dispatch.sendImages(state.base64Images, UID);
|
47
|
+
}
|
48
|
+
}, [dispatch.sendImages, dispatch.handleLoading, state.base64Images, base64ImagesCount]);
|
49
|
+
|
50
|
+
useEffect(() => {
|
51
|
+
if (state.code === 0) {
|
52
|
+
dispatch.setModal("Sucesso!", "Cadastro de digital realizado com sucesso!");
|
53
|
+
onSuccess && onSuccess?.(state.code);
|
54
|
+
dispatch.handleLoading();
|
55
|
+
}
|
56
|
+
if (state.code !== 0 && state.code !== null) {
|
57
|
+
dispatch.setModal("Ocorreu um erro!", `Erro: ${state.message}`);
|
58
|
+
dispatch.handleLoading();
|
59
|
+
}
|
60
|
+
dispatch.resetState();
|
61
|
+
}, [state.code, state.message, dispatch.handleLoading, dispatch.resetState, dispatch.setModal]);
|
62
|
+
|
63
|
+
const cameraPermission = useCallback(async () => {
|
64
|
+
if (!hasPermission) {
|
65
|
+
await requestPermission();
|
66
|
+
}
|
67
|
+
}, [hasPermission, requestPermission]);
|
68
|
+
|
69
|
+
useEffect(() => {
|
70
|
+
cameraPermission();
|
71
|
+
dispatch.getConfig("finger");
|
72
|
+
}, [cameraPermission]);
|
73
|
+
|
74
|
+
const containerCaptureStyled = useMemo(
|
75
|
+
() => [styles.containerCapture, { bottom: state.showButtonInfo ? 75 : 20 }],
|
76
|
+
[state.showButtonInfo]
|
77
|
+
);
|
78
|
+
|
79
|
+
const cameraFormat = useCameraFormat(device, [
|
80
|
+
{
|
81
|
+
photoResolution: {
|
82
|
+
width: 1920,
|
83
|
+
height: 1080
|
84
|
+
},
|
85
|
+
pixelFormat: "native"
|
86
|
+
}
|
87
|
+
]);
|
88
|
+
|
89
|
+
const takePhoto = async () => {
|
90
|
+
const photo = await cameraRef.current?.takePhoto({
|
91
|
+
qualityPrioritization: qualityPrioritization,
|
92
|
+
flash: "on"
|
93
|
+
});
|
94
|
+
if (photo != null) dispatch.setImagePath(photo.path);
|
95
|
+
};
|
96
|
+
|
97
|
+
const focus = useCallback((point: Point) => {
|
98
|
+
const camera = cameraRef.current;
|
99
|
+
if (camera != null) {
|
100
|
+
camera.focus(point);
|
101
|
+
}
|
102
|
+
}, []);
|
103
|
+
|
104
|
+
const gesture = Gesture.Tap().onBegin(({ x, y }) => {
|
105
|
+
runOnJS(focus)({ x, y });
|
106
|
+
});
|
107
|
+
|
108
|
+
if (device == null || hasPermission === false)
|
109
|
+
return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
|
110
|
+
|
111
|
+
return (
|
112
|
+
<GestureHandlerRootView style={styles.root}>
|
113
|
+
<HelpRegister />
|
114
|
+
<GestureDetector gesture={gesture}>
|
115
|
+
<View style={styles.cameraContainer}>
|
116
|
+
<Camera
|
117
|
+
ref={cameraRef}
|
118
|
+
style={styles.camera}
|
119
|
+
isActive={true}
|
120
|
+
device={device}
|
121
|
+
format={cameraFormat}
|
122
|
+
torch={"on"}
|
123
|
+
focusable={true}
|
124
|
+
exposure={state.exposure}
|
125
|
+
zoom={state.exposure}
|
126
|
+
photo={true}
|
127
|
+
enableHighQualityPhotos={true}
|
128
|
+
/>
|
129
|
+
<Gabarito />
|
130
|
+
</View>
|
131
|
+
</GestureDetector>
|
132
|
+
<View style={containerCaptureStyled}>
|
133
|
+
<CaptureButton onPress={takePhoto} imagesCount={base64ImagesCount} />
|
134
|
+
</View>
|
135
|
+
{state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.zoom} />}
|
136
|
+
<ModalMessage isLoading={state.loading} modal={state.modal} />
|
137
|
+
</GestureHandlerRootView>
|
138
|
+
);
|
139
|
+
};
|
140
|
+
|
141
|
+
export default FingerRegister;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { StyleSheet, Dimensions } from "react-native";
|
2
|
+
|
3
|
+
const { height } = Dimensions.get("window");
|
4
|
+
|
5
|
+
export const styles = StyleSheet.create({
|
6
|
+
container: {
|
7
|
+
flex: 1
|
8
|
+
},
|
9
|
+
root: {
|
10
|
+
flex: 1
|
11
|
+
},
|
12
|
+
cameraContainer: {
|
13
|
+
flex: 1,
|
14
|
+
justifyContent: "center"
|
15
|
+
},
|
16
|
+
camera: {
|
17
|
+
flex: 1,
|
18
|
+
paddingBottom: height * 0.2
|
19
|
+
},
|
20
|
+
containerCapture: {
|
21
|
+
position: "absolute",
|
22
|
+
width: "100%",
|
23
|
+
alignItems: "center"
|
24
|
+
},
|
25
|
+
cameraConfigs: {
|
26
|
+
alignItems: "center"
|
27
|
+
}
|
28
|
+
});
|