@ha_tecno/live-id-sdk 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js +3 -6
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js.map +1 -1
- package/lib/commonjs/screens/FingerRegister/FingerRegister.js +3 -6
- package/lib/commonjs/screens/FingerRegister/FingerRegister.js.map +1 -1
- package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js +3 -7
- package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js.map +1 -1
- package/lib/commonjs/utils/hooks/useIsForeground.js +23 -0
- package/lib/commonjs/utils/hooks/useIsForeground.js.map +1 -0
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/index.js +0 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/FingerAuth/FingerAuth.js +3 -6
- package/lib/module/screens/FingerAuth/FingerAuth.js.map +1 -1
- package/lib/module/screens/FingerRegister/FingerRegister.js +3 -6
- package/lib/module/screens/FingerRegister/FingerRegister.js.map +1 -1
- package/lib/module/screens/LifeCertificate/LifeCertificate.js +3 -7
- package/lib/module/screens/LifeCertificate/LifeCertificate.js.map +1 -1
- package/lib/module/utils/hooks/useIsForeground.js +16 -0
- package/lib/module/utils/hooks/useIsForeground.js.map +1 -0
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts +1 -2
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts.map +1 -1
- package/lib/typescript/src/screens/FingerRegister/FingerRegister.d.ts +1 -2
- package/lib/typescript/src/screens/FingerRegister/FingerRegister.d.ts.map +1 -1
- package/lib/typescript/src/screens/LifeCertificate/LifeCertificate.d.ts.map +1 -1
- package/lib/typescript/src/utils/hooks/useIsForeground.d.ts +2 -0
- package/lib/typescript/src/utils/hooks/useIsForeground.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +2 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/index.tsx +0 -4
- package/src/screens/FingerAuth/FingerAuth.tsx +4 -7
- package/src/screens/FingerRegister/FingerRegister.tsx +4 -7
- package/src/screens/LifeCertificate/LifeCertificate.tsx +2 -6
- package/src/utils/hooks/useIsForeground.ts +18 -0
- package/src/utils/index.ts +2 -1
- package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js +0 -186
- package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js.map +0 -1
- package/lib/module/screens/CadastroScreen/CadastroScreen.js +0 -177
- package/lib/module/screens/CadastroScreen/CadastroScreen.js.map +0 -1
- package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts +0 -12
- package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts.map +0 -1
- package/src/screens/CadastroScreen/CadastroScreen.tsx +0 -195
@@ -1,9 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
type Props = {
|
3
3
|
UID: string;
|
4
|
-
qualityPrioritization?: "speed" | "quality" | "balanced";
|
5
4
|
onSuccess: (code: number) => void;
|
6
5
|
};
|
7
|
-
declare const FingerAuth: ({ UID,
|
6
|
+
declare const FingerAuth: ({ UID, onSuccess }: Props) => JSX.Element;
|
8
7
|
export default FingerAuth;
|
9
8
|
//# sourceMappingURL=FingerAuth.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FingerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/screens/FingerAuth/FingerAuth.tsx"],"names":[],"mappings":";AAYA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,
|
1
|
+
{"version":3,"file":"FingerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/screens/FingerAuth/FingerAuth.tsx"],"names":[],"mappings":";AAYA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,UAAU,uBAAwB,KAAK,gBAkG5C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
type Props = {
|
3
3
|
UID: string;
|
4
|
-
qualityPrioritization: "speed" | "quality" | "balanced";
|
5
4
|
onSuccess: (code: number) => void;
|
6
5
|
};
|
7
|
-
declare const FingerRegister: ({ UID,
|
6
|
+
declare const FingerRegister: ({ UID, onSuccess }: Props) => JSX.Element;
|
8
7
|
export default FingerRegister;
|
9
8
|
//# sourceMappingURL=FingerRegister.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FingerRegister.d.ts","sourceRoot":"","sources":["../../../../../src/screens/FingerRegister/FingerRegister.tsx"],"names":[],"mappings":";AAYA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,
|
1
|
+
{"version":3,"file":"FingerRegister.d.ts","sourceRoot":"","sources":["../../../../../src/screens/FingerRegister/FingerRegister.tsx"],"names":[],"mappings":";AAYA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,cAAc,uBAAwB,KAAK,gBA6GhD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LifeCertificate.d.ts","sourceRoot":"","sources":["../../../../../src/screens/LifeCertificate/LifeCertificate.tsx"],"names":[],"mappings":";AASA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,eAAe,YAAa,KAAK,
|
1
|
+
{"version":3,"file":"LifeCertificate.d.ts","sourceRoot":"","sources":["../../../../../src/screens/LifeCertificate/LifeCertificate.tsx"],"names":[],"mappings":";AASA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,eAAe,YAAa,KAAK,gBAuItC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useIsForeground.d.ts","sourceRoot":"","sources":["../../../../../src/utils/hooks/useIsForeground.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,eAc3B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ha_tecno/live-id-sdk",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.4.0",
|
4
4
|
"description": "React Native SDK for Live ID",
|
5
5
|
"main": "lib/commonjs/index",
|
6
6
|
"module": "lib/module/index",
|
@@ -142,7 +142,6 @@
|
|
142
142
|
]
|
143
143
|
},
|
144
144
|
"dependencies": {
|
145
|
-
"@react-native-community/hooks": "^3.0.0",
|
146
145
|
"axios": "^1.6.8",
|
147
146
|
"firebase": "^10.7.2",
|
148
147
|
"react-native-device-info": "^10.13.1",
|
package/src/index.tsx
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from "react";
|
2
2
|
import { View } from "react-native";
|
3
|
-
import { useAppState } from "@react-native-community/hooks";
|
4
3
|
import { Camera, useCameraFormat, Point, useCameraDevice, useCameraPermission } from "react-native-vision-camera";
|
5
4
|
import Orientation from "react-native-orientation-locker";
|
6
5
|
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
|
@@ -8,18 +7,17 @@ import { runOnJS } from "react-native-reanimated";
|
|
8
7
|
|
9
8
|
import { styles } from "./styles";
|
10
9
|
import { DeviceNotFound, Gabarito, CameraConfigInfo, ModalMessage, CaptureButton } from "../../components";
|
10
|
+
import { useIsForeground } from "../../utils";
|
11
11
|
import { useDispatch, useSelector } from "../../store/modules/fingerAuth";
|
12
12
|
|
13
13
|
type Props = {
|
14
14
|
UID: string;
|
15
|
-
qualityPrioritization?: "speed" | "quality" | "balanced";
|
16
15
|
onSuccess: (code: number) => void;
|
17
16
|
};
|
18
17
|
|
19
|
-
const FingerAuth = ({ UID,
|
18
|
+
const FingerAuth = ({ UID, onSuccess }: Props) => {
|
20
19
|
const cameraRef = useRef<Camera>(null);
|
21
|
-
const
|
22
|
-
const isActive = appState === "active";
|
20
|
+
const isActive = useIsForeground();
|
23
21
|
const { hasPermission, requestPermission } = useCameraPermission();
|
24
22
|
const device = useCameraDevice("back");
|
25
23
|
const dispatch = useDispatch();
|
@@ -69,8 +67,7 @@ const FingerAuth = ({ UID, qualityPrioritization, onSuccess }: Props) => {
|
|
69
67
|
|
70
68
|
const takePhoto = async () => {
|
71
69
|
const photo = await cameraRef.current?.takePhoto({
|
72
|
-
qualityPrioritization:
|
73
|
-
flash: "on"
|
70
|
+
qualityPrioritization: "balanced"
|
74
71
|
});
|
75
72
|
if (photo != null) dispatch.sendImage(photo.path, UID);
|
76
73
|
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from "react";
|
2
2
|
import { View } from "react-native";
|
3
|
-
import { useAppState } from "@react-native-community/hooks";
|
4
3
|
import { Camera, useCameraFormat, type Point, useCameraDevice, useCameraPermission } from "react-native-vision-camera";
|
5
4
|
import Orientation from "react-native-orientation-locker";
|
6
5
|
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
|
@@ -9,17 +8,16 @@ import { runOnJS } from "react-native-reanimated";
|
|
9
8
|
import { styles } from "./styles";
|
10
9
|
import { useSelector, useDispatch } from "../../store/modules/fingerRegister";
|
11
10
|
import { CaptureButton, DeviceNotFound, ModalMessage, CameraConfigInfo, Gabarito } from "../../components";
|
11
|
+
import { useIsForeground } from "../../utils";
|
12
12
|
|
13
13
|
type Props = {
|
14
14
|
UID: string;
|
15
|
-
qualityPrioritization: "speed" | "quality" | "balanced";
|
16
15
|
onSuccess: (code: number) => void;
|
17
16
|
};
|
18
17
|
|
19
|
-
const FingerRegister = ({ UID,
|
18
|
+
const FingerRegister = ({ UID, onSuccess }: Props) => {
|
20
19
|
const cameraRef = useRef<Camera>(null);
|
21
|
-
const
|
22
|
-
const isActive = appState === "active";
|
20
|
+
const isActive = useIsForeground();
|
23
21
|
const { hasPermission, requestPermission } = useCameraPermission();
|
24
22
|
const state = useSelector();
|
25
23
|
const dispatch = useDispatch();
|
@@ -80,8 +78,7 @@ const FingerRegister = ({ UID, qualityPrioritization, onSuccess }: Props) => {
|
|
80
78
|
|
81
79
|
const takePhoto = async () => {
|
82
80
|
const photo = await cameraRef.current?.takePhoto({
|
83
|
-
qualityPrioritization:
|
84
|
-
flash: "on"
|
81
|
+
qualityPrioritization: "balanced"
|
85
82
|
});
|
86
83
|
if (photo != null) dispatch.setImagePath(photo.path);
|
87
84
|
};
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
2
2
|
import { StatusBar, View } from "react-native";
|
3
|
-
import { useAppState } from "@react-native-community/hooks";
|
4
3
|
import Orientation from "react-native-orientation-locker";
|
5
4
|
import { Camera, VideoFile, useCameraDevice, useCameraFormat, useCameraPermission } from "react-native-vision-camera";
|
6
5
|
import { useDispatch, useSelector } from "../../store/modules/lifeCertificate";
|
7
6
|
import { DeviceNotFound, ModalMessage, RecordButton, CameraConfigInfo } from "../../components";
|
8
7
|
import { styles } from "./styles";
|
8
|
+
import { useIsForeground } from "../../utils";
|
9
9
|
|
10
10
|
type Props = {
|
11
11
|
UID: string;
|
@@ -13,8 +13,7 @@ type Props = {
|
|
13
13
|
|
14
14
|
const LifeCertificate = ({ UID }: Props) => {
|
15
15
|
const camera = useRef<Camera>(null);
|
16
|
-
const
|
17
|
-
const isActive = appState === "active";
|
16
|
+
const isActive = useIsForeground();
|
18
17
|
const state = useSelector();
|
19
18
|
const dispatch = useDispatch();
|
20
19
|
const { hasPermission, requestPermission } = useCameraPermission();
|
@@ -133,10 +132,7 @@ const LifeCertificate = ({ UID }: Props) => {
|
|
133
132
|
exposure={state.exposure}
|
134
133
|
zoom={state.zoom}
|
135
134
|
focusable={true}
|
136
|
-
photo={true}
|
137
|
-
enableHighQualityPhotos={true}
|
138
135
|
fps={30}
|
139
|
-
pixelFormat="native"
|
140
136
|
/>
|
141
137
|
<View style={containerRecordStyled}>
|
142
138
|
<RecordButton
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { useState, useEffect } from "react";
|
2
|
+
import { AppState, AppStateStatus } from "react-native";
|
3
|
+
|
4
|
+
export const useIsForeground = () => {
|
5
|
+
const [isForeground, setIsForeground] = useState(true);
|
6
|
+
|
7
|
+
useEffect(() => {
|
8
|
+
const onChange = (state: AppStateStatus): void => {
|
9
|
+
setIsForeground(state === "active");
|
10
|
+
};
|
11
|
+
const listener = AppState.addEventListener("change", onChange);
|
12
|
+
return () => {
|
13
|
+
listener.remove();
|
14
|
+
};
|
15
|
+
}, [setIsForeground]);
|
16
|
+
|
17
|
+
return isForeground;
|
18
|
+
};
|
package/src/utils/index.ts
CHANGED
@@ -1,186 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.CadastroScreen = void 0;
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
8
|
-
var _reactNative = require("react-native");
|
9
|
-
var _services = require("../../services");
|
10
|
-
var _reactNativeModal = _interopRequireDefault(require("react-native-modal"));
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react-native/no-inline-styles */
|
15
|
-
const CadastroScreen = ({
|
16
|
-
isVisible = false,
|
17
|
-
onCloseModal,
|
18
|
-
onError,
|
19
|
-
onSuccess,
|
20
|
-
ModalParams
|
21
|
-
}) => {
|
22
|
-
const [cpf, setCpf] = (0, _react.useState)("");
|
23
|
-
const [nome, setNome] = (0, _react.useState)("");
|
24
|
-
const [senha, setSenha] = (0, _react.useState)("");
|
25
|
-
const [confirmarSenha, setConfirmarSenha] = (0, _react.useState)("");
|
26
|
-
const generateRandomElevenDigits = () => {
|
27
|
-
let cpf = "";
|
28
|
-
for (let i = 0; i < 11; i++) {
|
29
|
-
cpf += Math.floor(Math.random() * 9);
|
30
|
-
}
|
31
|
-
return cpf;
|
32
|
-
};
|
33
|
-
const generateRandomName = () => {
|
34
|
-
// uma strin aleatória de 10 caracteres a 14 caracteres
|
35
|
-
let name = "";
|
36
|
-
const length = Math.floor(Math.random() * 5) + 10;
|
37
|
-
for (let i = 0; i < length; i++) {
|
38
|
-
name += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
|
39
|
-
}
|
40
|
-
return name;
|
41
|
-
};
|
42
|
-
(0, _react.useEffect)(() => {
|
43
|
-
generateRnadomUser();
|
44
|
-
}, []);
|
45
|
-
const generateRnadomUser = () => {
|
46
|
-
setCpf(generateRandomElevenDigits());
|
47
|
-
setNome(generateRandomName());
|
48
|
-
setSenha("123");
|
49
|
-
setConfirmarSenha("123");
|
50
|
-
};
|
51
|
-
const handleCadastro = async () => {
|
52
|
-
try {
|
53
|
-
if (senha === confirmarSenha) {
|
54
|
-
const response = await (0, _services.cadastro)(cpf, nome, senha);
|
55
|
-
console.log(response);
|
56
|
-
var jsonString = JSON.stringify(response);
|
57
|
-
onSuccess && onSuccess(response);
|
58
|
-
onCloseModalHandler();
|
59
|
-
if (jsonString.includes("person_id")) {
|
60
|
-
if (response.finger === false) {
|
61
|
-
// openModal({
|
62
|
-
// type: 'ajuda',
|
63
|
-
// screenProps: {
|
64
|
-
// id: response.person_id,
|
65
|
-
// },
|
66
|
-
// });
|
67
|
-
} else {
|
68
|
-
// openModal({
|
69
|
-
// type: 'login',
|
70
|
-
// });
|
71
|
-
}
|
72
|
-
} else if (jsonString.includes("User exists")) {
|
73
|
-
_reactNative.Alert.alert("Usuário já cadastrado!");
|
74
|
-
// openModal({
|
75
|
-
// type: 'login',
|
76
|
-
// });
|
77
|
-
} else if (jsonString.includes("erro")) {
|
78
|
-
_reactNative.Alert.alert("Usuário não cadastrado", "Por favor, cadastre-se!");
|
79
|
-
} else {
|
80
|
-
_reactNative.Alert.alert("Erro", "Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.");
|
81
|
-
}
|
82
|
-
} else {
|
83
|
-
_reactNative.Alert.alert("Erro", "As senhas não coincidem. Por favor, tente novamente.");
|
84
|
-
return;
|
85
|
-
}
|
86
|
-
} catch (error) {
|
87
|
-
onError && onError(error);
|
88
|
-
console.error(error);
|
89
|
-
}
|
90
|
-
};
|
91
|
-
const onCloseModalHandler = () => {
|
92
|
-
onCloseModal && onCloseModal();
|
93
|
-
generateRnadomUser();
|
94
|
-
};
|
95
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeModal.default, _extends({
|
96
|
-
style: {
|
97
|
-
margin: 0
|
98
|
-
},
|
99
|
-
isVisible: isVisible,
|
100
|
-
swipeDirection: "down",
|
101
|
-
propagateSwipe: true,
|
102
|
-
onSwipeComplete: onCloseModalHandler
|
103
|
-
}, ModalParams), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
104
|
-
style: styles.container
|
105
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
106
|
-
source: require("../../assets/logo.png"),
|
107
|
-
style: styles.logo
|
108
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
109
|
-
style: styles.title
|
110
|
-
}, "Cadastro de usu\xE1rio"), /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
111
|
-
style: styles.input,
|
112
|
-
placeholder: "CPF",
|
113
|
-
placeholderTextColor: "#000",
|
114
|
-
keyboardType: "numeric",
|
115
|
-
value: cpf,
|
116
|
-
onChangeText: setCpf
|
117
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
118
|
-
style: styles.input,
|
119
|
-
placeholder: "Nome",
|
120
|
-
placeholderTextColor: "#000",
|
121
|
-
value: nome,
|
122
|
-
onChangeText: setNome
|
123
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
124
|
-
style: styles.input,
|
125
|
-
placeholder: "Digite a senha",
|
126
|
-
placeholderTextColor: "#000",
|
127
|
-
secureTextEntry: true,
|
128
|
-
value: senha,
|
129
|
-
onChangeText: text => setSenha(text)
|
130
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
131
|
-
style: styles.input,
|
132
|
-
placeholderTextColor: "#000",
|
133
|
-
placeholder: "Digite a senha novamente",
|
134
|
-
secureTextEntry: true,
|
135
|
-
value: confirmarSenha,
|
136
|
-
onChangeText: text => setConfirmarSenha(text)
|
137
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
138
|
-
style: styles.button,
|
139
|
-
onPress: handleCadastro
|
140
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
141
|
-
style: styles.buttonText
|
142
|
-
}, "Cadastrar"))));
|
143
|
-
};
|
144
|
-
exports.CadastroScreen = CadastroScreen;
|
145
|
-
const styles = _reactNative.StyleSheet.create({
|
146
|
-
container: {
|
147
|
-
flex: 1,
|
148
|
-
alignItems: "center",
|
149
|
-
justifyContent: "center",
|
150
|
-
backgroundColor: "#fff"
|
151
|
-
},
|
152
|
-
title: {
|
153
|
-
fontSize: 24,
|
154
|
-
marginBottom: 16,
|
155
|
-
color: "#00bfff"
|
156
|
-
},
|
157
|
-
input: {
|
158
|
-
width: "80%",
|
159
|
-
height: 50,
|
160
|
-
padding: 10,
|
161
|
-
borderWidth: 1,
|
162
|
-
borderColor: "#ccc",
|
163
|
-
borderRadius: 4,
|
164
|
-
marginBottom: 16,
|
165
|
-
fontSize: 16,
|
166
|
-
color: "#000"
|
167
|
-
},
|
168
|
-
button: {
|
169
|
-
width: "80%",
|
170
|
-
height: 50,
|
171
|
-
backgroundColor: "#00bfff",
|
172
|
-
borderRadius: 4,
|
173
|
-
alignItems: "center",
|
174
|
-
justifyContent: "center"
|
175
|
-
},
|
176
|
-
buttonText: {
|
177
|
-
fontSize: 16,
|
178
|
-
color: "#fff"
|
179
|
-
},
|
180
|
-
logo: {
|
181
|
-
width: 500,
|
182
|
-
height: 250,
|
183
|
-
resizeMode: "contain"
|
184
|
-
}
|
185
|
-
});
|
186
|
-
//# sourceMappingURL=CadastroScreen.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_services","_reactNativeModal","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","CadastroScreen","isVisible","onCloseModal","onError","onSuccess","ModalParams","cpf","setCpf","useState","nome","setNome","senha","setSenha","confirmarSenha","setConfirmarSenha","generateRandomElevenDigits","Math","floor","random","generateRandomName","name","String","fromCharCode","useEffect","generateRnadomUser","handleCadastro","response","cadastro","console","log","jsonString","JSON","stringify","onCloseModalHandler","includes","finger","Alert","alert","error","createElement","style","margin","swipeDirection","propagateSwipe","onSwipeComplete","View","styles","container","Image","logo","Text","title","TextInput","input","placeholder","placeholderTextColor","keyboardType","value","onChangeText","secureTextEntry","text","TouchableOpacity","button","onPress","buttonText","exports","StyleSheet","create","flex","alignItems","justifyContent","backgroundColor","fontSize","marginBottom","color","width","height","padding","borderWidth","borderColor","borderRadius","resizeMode"],"sourceRoot":"../../../../src","sources":["screens/CadastroScreen/CadastroScreen.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA4D,SAAAI,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAA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,GAAC,WAAe,CAC/B,CACd,CACD,CAAC;AAEZ,CAAC;AAACC,OAAA,CAAAjE,cAAA,GAAAA,cAAA;AAEF,MAAM8C,MAAM,GAAGoB,uBAAU,CAACC,MAAM,CAAC;EAC/BpB,SAAS,EAAE;IACTqB,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,eAAe,EAAE;EACnB,CAAC;EACDpB,KAAK,EAAE;IACLqB,QAAQ,EAAE,EAAE;IACZC,YAAY,EAAE,EAAE;IAChBC,KAAK,EAAE;EACT,CAAC;EACDrB,KAAK,EAAE;IACLsB,KAAK,EAAE,KAAK;IACZC,MAAM,EAAE,EAAE;IACVC,OAAO,EAAE,EAAE;IACXC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE,CAAC;IACfP,YAAY,EAAE,EAAE;IAChBD,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE;EACT,CAAC;EACDZ,MAAM,EAAE;IACNa,KAAK,EAAE,KAAK;IACZC,MAAM,EAAE,EAAE;IACVL,eAAe,EAAE,SAAS;IAC1BS,YAAY,EAAE,CAAC;IACfX,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDN,UAAU,EAAE;IACVQ,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE;EACT,CAAC;EACDzB,IAAI,EAAE;IACJ0B,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,GAAG;IACXK,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
@@ -1,177 +0,0 @@
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
-
/* eslint-disable react-native/no-inline-styles */
|
3
|
-
import React, { useEffect, useState } from "react";
|
4
|
-
import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert, Image } from "react-native";
|
5
|
-
import { cadastro } from "../../services";
|
6
|
-
import Modal from "react-native-modal";
|
7
|
-
export const CadastroScreen = ({
|
8
|
-
isVisible = false,
|
9
|
-
onCloseModal,
|
10
|
-
onError,
|
11
|
-
onSuccess,
|
12
|
-
ModalParams
|
13
|
-
}) => {
|
14
|
-
const [cpf, setCpf] = useState("");
|
15
|
-
const [nome, setNome] = useState("");
|
16
|
-
const [senha, setSenha] = useState("");
|
17
|
-
const [confirmarSenha, setConfirmarSenha] = useState("");
|
18
|
-
const generateRandomElevenDigits = () => {
|
19
|
-
let cpf = "";
|
20
|
-
for (let i = 0; i < 11; i++) {
|
21
|
-
cpf += Math.floor(Math.random() * 9);
|
22
|
-
}
|
23
|
-
return cpf;
|
24
|
-
};
|
25
|
-
const generateRandomName = () => {
|
26
|
-
// uma strin aleatória de 10 caracteres a 14 caracteres
|
27
|
-
let name = "";
|
28
|
-
const length = Math.floor(Math.random() * 5) + 10;
|
29
|
-
for (let i = 0; i < length; i++) {
|
30
|
-
name += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
|
31
|
-
}
|
32
|
-
return name;
|
33
|
-
};
|
34
|
-
useEffect(() => {
|
35
|
-
generateRnadomUser();
|
36
|
-
}, []);
|
37
|
-
const generateRnadomUser = () => {
|
38
|
-
setCpf(generateRandomElevenDigits());
|
39
|
-
setNome(generateRandomName());
|
40
|
-
setSenha("123");
|
41
|
-
setConfirmarSenha("123");
|
42
|
-
};
|
43
|
-
const handleCadastro = async () => {
|
44
|
-
try {
|
45
|
-
if (senha === confirmarSenha) {
|
46
|
-
const response = await cadastro(cpf, nome, senha);
|
47
|
-
console.log(response);
|
48
|
-
var jsonString = JSON.stringify(response);
|
49
|
-
onSuccess && onSuccess(response);
|
50
|
-
onCloseModalHandler();
|
51
|
-
if (jsonString.includes("person_id")) {
|
52
|
-
if (response.finger === false) {
|
53
|
-
// openModal({
|
54
|
-
// type: 'ajuda',
|
55
|
-
// screenProps: {
|
56
|
-
// id: response.person_id,
|
57
|
-
// },
|
58
|
-
// });
|
59
|
-
} else {
|
60
|
-
// openModal({
|
61
|
-
// type: 'login',
|
62
|
-
// });
|
63
|
-
}
|
64
|
-
} else if (jsonString.includes("User exists")) {
|
65
|
-
Alert.alert("Usuário já cadastrado!");
|
66
|
-
// openModal({
|
67
|
-
// type: 'login',
|
68
|
-
// });
|
69
|
-
} else if (jsonString.includes("erro")) {
|
70
|
-
Alert.alert("Usuário não cadastrado", "Por favor, cadastre-se!");
|
71
|
-
} else {
|
72
|
-
Alert.alert("Erro", "Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.");
|
73
|
-
}
|
74
|
-
} else {
|
75
|
-
Alert.alert("Erro", "As senhas não coincidem. Por favor, tente novamente.");
|
76
|
-
return;
|
77
|
-
}
|
78
|
-
} catch (error) {
|
79
|
-
onError && onError(error);
|
80
|
-
console.error(error);
|
81
|
-
}
|
82
|
-
};
|
83
|
-
const onCloseModalHandler = () => {
|
84
|
-
onCloseModal && onCloseModal();
|
85
|
-
generateRnadomUser();
|
86
|
-
};
|
87
|
-
return /*#__PURE__*/React.createElement(Modal, _extends({
|
88
|
-
style: {
|
89
|
-
margin: 0
|
90
|
-
},
|
91
|
-
isVisible: isVisible,
|
92
|
-
swipeDirection: "down",
|
93
|
-
propagateSwipe: true,
|
94
|
-
onSwipeComplete: onCloseModalHandler
|
95
|
-
}, ModalParams), /*#__PURE__*/React.createElement(View, {
|
96
|
-
style: styles.container
|
97
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
98
|
-
source: require("../../assets/logo.png"),
|
99
|
-
style: styles.logo
|
100
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
101
|
-
style: styles.title
|
102
|
-
}, "Cadastro de usu\xE1rio"), /*#__PURE__*/React.createElement(TextInput, {
|
103
|
-
style: styles.input,
|
104
|
-
placeholder: "CPF",
|
105
|
-
placeholderTextColor: "#000",
|
106
|
-
keyboardType: "numeric",
|
107
|
-
value: cpf,
|
108
|
-
onChangeText: setCpf
|
109
|
-
}), /*#__PURE__*/React.createElement(TextInput, {
|
110
|
-
style: styles.input,
|
111
|
-
placeholder: "Nome",
|
112
|
-
placeholderTextColor: "#000",
|
113
|
-
value: nome,
|
114
|
-
onChangeText: setNome
|
115
|
-
}), /*#__PURE__*/React.createElement(TextInput, {
|
116
|
-
style: styles.input,
|
117
|
-
placeholder: "Digite a senha",
|
118
|
-
placeholderTextColor: "#000",
|
119
|
-
secureTextEntry: true,
|
120
|
-
value: senha,
|
121
|
-
onChangeText: text => setSenha(text)
|
122
|
-
}), /*#__PURE__*/React.createElement(TextInput, {
|
123
|
-
style: styles.input,
|
124
|
-
placeholderTextColor: "#000",
|
125
|
-
placeholder: "Digite a senha novamente",
|
126
|
-
secureTextEntry: true,
|
127
|
-
value: confirmarSenha,
|
128
|
-
onChangeText: text => setConfirmarSenha(text)
|
129
|
-
}), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
130
|
-
style: styles.button,
|
131
|
-
onPress: handleCadastro
|
132
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
133
|
-
style: styles.buttonText
|
134
|
-
}, "Cadastrar"))));
|
135
|
-
};
|
136
|
-
const styles = StyleSheet.create({
|
137
|
-
container: {
|
138
|
-
flex: 1,
|
139
|
-
alignItems: "center",
|
140
|
-
justifyContent: "center",
|
141
|
-
backgroundColor: "#fff"
|
142
|
-
},
|
143
|
-
title: {
|
144
|
-
fontSize: 24,
|
145
|
-
marginBottom: 16,
|
146
|
-
color: "#00bfff"
|
147
|
-
},
|
148
|
-
input: {
|
149
|
-
width: "80%",
|
150
|
-
height: 50,
|
151
|
-
padding: 10,
|
152
|
-
borderWidth: 1,
|
153
|
-
borderColor: "#ccc",
|
154
|
-
borderRadius: 4,
|
155
|
-
marginBottom: 16,
|
156
|
-
fontSize: 16,
|
157
|
-
color: "#000"
|
158
|
-
},
|
159
|
-
button: {
|
160
|
-
width: "80%",
|
161
|
-
height: 50,
|
162
|
-
backgroundColor: "#00bfff",
|
163
|
-
borderRadius: 4,
|
164
|
-
alignItems: "center",
|
165
|
-
justifyContent: "center"
|
166
|
-
},
|
167
|
-
buttonText: {
|
168
|
-
fontSize: 16,
|
169
|
-
color: "#fff"
|
170
|
-
},
|
171
|
-
logo: {
|
172
|
-
width: 500,
|
173
|
-
height: 250,
|
174
|
-
resizeMode: "contain"
|
175
|
-
}
|
176
|
-
});
|
177
|
-
//# sourceMappingURL=CadastroScreen.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","View","Text","TextInput","TouchableOpacity","StyleSheet","Alert","Image","cadastro","Modal","CadastroScreen","isVisible","onCloseModal","onError","onSuccess","ModalParams","cpf","setCpf","nome","setNome","senha","setSenha","confirmarSenha","setConfirmarSenha","generateRandomElevenDigits","i","Math","floor","random","generateRandomName","name","length","String","fromCharCode","generateRnadomUser","handleCadastro","response","console","log","jsonString","JSON","stringify","onCloseModalHandler","includes","finger","alert","error","createElement","_extends","style","margin","swipeDirection","propagateSwipe","onSwipeComplete","styles","container","source","require","logo","title","input","placeholder","placeholderTextColor","keyboardType","value","onChangeText","secureTextEntry","text","button","onPress","buttonText","create","flex","alignItems","justifyContent","backgroundColor","fontSize","marginBottom","color","width","height","padding","borderWidth","borderColor","borderRadius","resizeMode"],"sourceRoot":"../../../../src","sources":["screens/CadastroScreen/CadastroScreen.tsx"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,QAAQ,cAAc;AAChG,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,KAAK,MAA2B,oBAAoB;AAU3D,OAAO,MAAMC,cAA6C,GAAGA,CAAC;EAC5DC,SAAS,GAAG,KAAK;EACjBC,Y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K,EAAE;EACT,CAAC;EACDV,MAAM,EAAE;IACNW,KAAK,EAAE,KAAK;IACZC,MAAM,EAAE,EAAE;IACVL,eAAe,EAAE,SAAS;IAC1BS,YAAY,EAAE,CAAC;IACfX,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDJ,UAAU,EAAE;IACVM,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE;EACT,CAAC;EACDpB,IAAI,EAAE;IACJqB,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,GAAG;IACXK,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { type ModalProps } from "react-native-modal";
|
3
|
-
interface CadastroScreenProps {
|
4
|
-
isVisible: boolean;
|
5
|
-
onCloseModal?: () => void;
|
6
|
-
onError?: (response?: any) => void;
|
7
|
-
onSuccess?: (response?: any) => void;
|
8
|
-
ModalParams?: ModalProps;
|
9
|
-
}
|
10
|
-
export declare const CadastroScreen: React.FC<CadastroScreenProps>;
|
11
|
-
export {};
|
12
|
-
//# sourceMappingURL=CadastroScreen.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CadastroScreen.d.ts","sourceRoot":"","sources":["../../../../../src/screens/CadastroScreen/CadastroScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,UAAU,mBAAmB;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0IxD,CAAC"}
|