react-native-timacare 3.3.17 → 3.3.18
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/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +272 -4
- package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +30 -46
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.flow +5 -8
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.flow +21 -23
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSelfie.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleCamera.js +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
- package/lib/typescript/screens/home/DigitalTopupItem.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/RegisterCamera.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/TTSSelfie.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/VehicleCamera.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/screens/home/DigitalTopupItem.tsx +272 -4
- package/src/screens/toan-trinh-so/RegisterCamera.tsx +30 -46
- package/src/screens/toan-trinh-so/TTSSelfie.tsx +5 -8
- package/src/screens/toan-trinh-so/VehicleCamera.tsx +21 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
ActivityIndicator,
|
|
@@ -6,17 +6,13 @@ import {
|
|
|
6
6
|
Image,
|
|
7
7
|
ImageStyle,
|
|
8
8
|
Platform,
|
|
9
|
-
SafeAreaView,
|
|
10
9
|
TextStyle,
|
|
11
10
|
TouchableOpacity,
|
|
12
11
|
View,
|
|
13
12
|
ViewStyle,
|
|
13
|
+
Alert,
|
|
14
14
|
} from 'react-native';
|
|
15
|
-
import {
|
|
16
|
-
CommonActions,
|
|
17
|
-
useNavigation,
|
|
18
|
-
useIsFocused,
|
|
19
|
-
} from '@react-navigation/native';
|
|
15
|
+
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
20
16
|
import {
|
|
21
17
|
request,
|
|
22
18
|
PERMISSIONS,
|
|
@@ -27,12 +23,7 @@ import { RNCamera } from 'react-native-camera';
|
|
|
27
23
|
import Modal from 'react-native-modal';
|
|
28
24
|
import { MText } from '../../components/MText';
|
|
29
25
|
import LinearGradient from 'react-native-linear-gradient';
|
|
30
|
-
import {
|
|
31
|
-
CloseIcon,
|
|
32
|
-
IconBackWhite,
|
|
33
|
-
TakePhotoSvg,
|
|
34
|
-
TimaSmall,
|
|
35
|
-
} from '../../assets/icons';
|
|
26
|
+
import { CloseIcon, TakePhotoSvg, TimaSmall } from '../../assets/icons';
|
|
36
27
|
import MButton from '../../components/MButton';
|
|
37
28
|
import { commonStyles } from '../CommonStyles';
|
|
38
29
|
import { load, OCR_V3, save } from '../../utils/storage';
|
|
@@ -41,8 +32,10 @@ import DeviceInfo from 'react-native-device-info';
|
|
|
41
32
|
import ImagePicker from 'react-native-image-crop-picker';
|
|
42
33
|
import { IconUpload } from '../../assets/svgs';
|
|
43
34
|
import { launchImageLibrary } from 'react-native-image-picker';
|
|
35
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
44
36
|
|
|
45
37
|
export default function RegisterCamera(props: any) {
|
|
38
|
+
const insets = useSafeAreaInsets();
|
|
46
39
|
const isFocused = useIsFocused();
|
|
47
40
|
const [shouldRenderCamera, setShouldRenderCamera] = useState(false);
|
|
48
41
|
const navigation = useNavigation();
|
|
@@ -252,7 +245,7 @@ export default function RegisterCamera(props: any) {
|
|
|
252
245
|
<View
|
|
253
246
|
style={{
|
|
254
247
|
marginVertical: 16,
|
|
255
|
-
marginTop:
|
|
248
|
+
marginTop: insets.top + 16,
|
|
256
249
|
}}
|
|
257
250
|
>
|
|
258
251
|
<TouchableOpacity
|
|
@@ -305,48 +298,39 @@ export default function RegisterCamera(props: any) {
|
|
|
305
298
|
{({ camera, status, recordAudioPermissionStatus }) => {
|
|
306
299
|
if (status !== 'READY') return <ActivityIndicator />;
|
|
307
300
|
}}
|
|
308
|
-
<View
|
|
309
|
-
style={{
|
|
310
|
-
alignItems: 'center',
|
|
311
|
-
position: 'absolute',
|
|
312
|
-
bottom: 0,
|
|
313
|
-
left: 0,
|
|
314
|
-
right: 0,
|
|
315
|
-
}}
|
|
316
|
-
>
|
|
317
|
-
<TouchableOpacity
|
|
318
|
-
onPress={() => {
|
|
319
|
-
pickImageFromGallery();
|
|
320
|
-
}}
|
|
321
|
-
style={{
|
|
322
|
-
flexDirection: 'row',
|
|
323
|
-
alignItems: 'center',
|
|
324
|
-
gap: 8,
|
|
325
|
-
marginTop: 16,
|
|
326
|
-
}}
|
|
327
|
-
>
|
|
328
|
-
<IconUpload />
|
|
329
|
-
<MText
|
|
330
|
-
style={{
|
|
331
|
-
color: 'white',
|
|
332
|
-
fontSize: 12,
|
|
333
|
-
}}
|
|
334
|
-
>
|
|
335
|
-
Tải ảnh từ thư viện
|
|
336
|
-
</MText>
|
|
337
|
-
</TouchableOpacity>
|
|
338
|
-
</View>
|
|
339
301
|
</RNCamera>
|
|
340
302
|
<View
|
|
341
303
|
style={{
|
|
342
304
|
position: 'absolute',
|
|
343
|
-
bottom:
|
|
305
|
+
bottom: insets.bottom,
|
|
344
306
|
left: 0,
|
|
345
307
|
right: 0,
|
|
346
308
|
}}
|
|
347
309
|
>
|
|
348
310
|
{!taking && (
|
|
349
311
|
<>
|
|
312
|
+
<View style={{ alignItems: 'center', marginBottom: 8 }}>
|
|
313
|
+
<TouchableOpacity
|
|
314
|
+
onPress={() => {
|
|
315
|
+
pickImageFromGallery();
|
|
316
|
+
}}
|
|
317
|
+
style={{
|
|
318
|
+
flexDirection: 'row',
|
|
319
|
+
alignItems: 'center',
|
|
320
|
+
gap: 8,
|
|
321
|
+
}}
|
|
322
|
+
>
|
|
323
|
+
<IconUpload />
|
|
324
|
+
<MText
|
|
325
|
+
style={{
|
|
326
|
+
color: 'white',
|
|
327
|
+
fontSize: 12,
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
Tải ảnh từ thư viện
|
|
331
|
+
</MText>
|
|
332
|
+
</TouchableOpacity>
|
|
333
|
+
</View>
|
|
350
334
|
<MText
|
|
351
335
|
style={{
|
|
352
336
|
color: 'white',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
ActivityIndicator,
|
|
@@ -7,11 +7,7 @@ import {
|
|
|
7
7
|
Platform,
|
|
8
8
|
View,
|
|
9
9
|
} from 'react-native';
|
|
10
|
-
import {
|
|
11
|
-
CommonActions,
|
|
12
|
-
useNavigation,
|
|
13
|
-
useIsFocused,
|
|
14
|
-
} from '@react-navigation/native';
|
|
10
|
+
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
15
11
|
import {
|
|
16
12
|
request,
|
|
17
13
|
PERMISSIONS,
|
|
@@ -26,11 +22,12 @@ import { IconBackWhite, TakePhotoSvg } from '../../assets/icons';
|
|
|
26
22
|
import Loading from '../../components/Loading';
|
|
27
23
|
import { Api } from '../../services/api';
|
|
28
24
|
import { ScreenNames } from '../../navigation';
|
|
29
|
-
import DeviceInfo from 'react-native-device-info';
|
|
30
25
|
import appStore from '../../AppStore';
|
|
31
26
|
import { logEvent, logEventFb } from '../../utils';
|
|
27
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
32
28
|
|
|
33
29
|
export default function TTSSelfie(props: any) {
|
|
30
|
+
const insets = useSafeAreaInsets();
|
|
34
31
|
const isFocused = useIsFocused();
|
|
35
32
|
const [shouldRenderCamera, setShouldRenderCamera] = useState(false);
|
|
36
33
|
const navigation = useNavigation();
|
|
@@ -221,7 +218,7 @@ export default function TTSSelfie(props: any) {
|
|
|
221
218
|
flexDirection: 'row',
|
|
222
219
|
alignItems: 'center',
|
|
223
220
|
justifyContent: 'center',
|
|
224
|
-
marginTop:
|
|
221
|
+
marginTop: insets.top + 16,
|
|
225
222
|
}}
|
|
226
223
|
>
|
|
227
224
|
<MButton
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
Alert,
|
|
5
5
|
Dimensions,
|
|
6
6
|
Image,
|
|
7
7
|
ImageStyle,
|
|
8
8
|
Platform,
|
|
9
|
-
SafeAreaView,
|
|
10
9
|
StyleSheet,
|
|
11
10
|
TextStyle,
|
|
12
11
|
TouchableOpacity,
|
|
13
12
|
View,
|
|
14
13
|
ViewStyle,
|
|
15
14
|
} from 'react-native';
|
|
16
|
-
import {
|
|
17
|
-
CommonActions,
|
|
18
|
-
useNavigation,
|
|
19
|
-
useIsFocused,
|
|
20
|
-
} from '@react-navigation/native';
|
|
15
|
+
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
21
16
|
import Modal from 'react-native-modal';
|
|
22
17
|
import { MText } from '../../components/MText';
|
|
23
18
|
import LinearGradient from 'react-native-linear-gradient';
|
|
@@ -41,14 +36,14 @@ import { load, OCR_V2, save } from '../../utils/storage';
|
|
|
41
36
|
import { IconUpload } from '../../assets/svgs';
|
|
42
37
|
import ImagePicker from 'react-native-image-crop-picker';
|
|
43
38
|
import { launchImageLibrary } from 'react-native-image-picker';
|
|
39
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
44
40
|
|
|
45
|
-
const { width: screenWidth
|
|
41
|
+
const { width: screenWidth } = Dimensions.get('window');
|
|
46
42
|
const frameWidth = screenWidth * 0.85;
|
|
47
43
|
const frameHeight = frameWidth * 0.63; // tỷ lệ giống CCCD
|
|
48
|
-
const frameLeft = (screenWidth - frameWidth) / 2;
|
|
49
|
-
const frameTop = ((screenWidth * 4) / 3 - frameHeight) / 2;
|
|
50
44
|
|
|
51
45
|
export default function VehicleCamera(props: any) {
|
|
46
|
+
const insets = useSafeAreaInsets();
|
|
52
47
|
const isFocused = useIsFocused();
|
|
53
48
|
const [cameraKey, setCameraKey] = useState(0);
|
|
54
49
|
|
|
@@ -276,15 +271,14 @@ export default function VehicleCamera(props: any) {
|
|
|
276
271
|
buttonPositive: 'Ok',
|
|
277
272
|
buttonNegative: 'Cancel',
|
|
278
273
|
}}
|
|
279
|
-
quality={0.
|
|
274
|
+
quality={0.9}
|
|
280
275
|
pictureSize="1280x720"
|
|
281
276
|
>
|
|
282
277
|
<View style={$overlay}>
|
|
283
278
|
<View style={$darkOverlayTop} />
|
|
284
|
-
<View style={$
|
|
279
|
+
<View style={$overlayRow}>
|
|
285
280
|
<View style={$darkOverlaySide} />
|
|
286
281
|
<View style={$frameBorder}>
|
|
287
|
-
{/* Top Left */}
|
|
288
282
|
<Corner
|
|
289
283
|
style={{
|
|
290
284
|
top: 0,
|
|
@@ -295,7 +289,6 @@ export default function VehicleCamera(props: any) {
|
|
|
295
289
|
}}
|
|
296
290
|
/>
|
|
297
291
|
|
|
298
|
-
{/* Top Right */}
|
|
299
292
|
<Corner
|
|
300
293
|
style={{
|
|
301
294
|
top: 0,
|
|
@@ -306,7 +299,6 @@ export default function VehicleCamera(props: any) {
|
|
|
306
299
|
}}
|
|
307
300
|
/>
|
|
308
301
|
|
|
309
|
-
{/* Bottom Left */}
|
|
310
302
|
<Corner
|
|
311
303
|
style={{
|
|
312
304
|
bottom: 0,
|
|
@@ -317,7 +309,6 @@ export default function VehicleCamera(props: any) {
|
|
|
317
309
|
}}
|
|
318
310
|
/>
|
|
319
311
|
|
|
320
|
-
{/* Bottom Right */}
|
|
321
312
|
<Corner
|
|
322
313
|
style={{
|
|
323
314
|
bottom: 0,
|
|
@@ -394,7 +385,7 @@ export default function VehicleCamera(props: any) {
|
|
|
394
385
|
</>
|
|
395
386
|
)}
|
|
396
387
|
</View>
|
|
397
|
-
<
|
|
388
|
+
<View
|
|
398
389
|
style={[
|
|
399
390
|
commonStyles.fill,
|
|
400
391
|
{ position: 'absolute', width: '100%', height: '100%' },
|
|
@@ -404,7 +395,7 @@ export default function VehicleCamera(props: any) {
|
|
|
404
395
|
style={[
|
|
405
396
|
commonStyles.row,
|
|
406
397
|
commonStyles.alignCenter,
|
|
407
|
-
{ paddingVertical: 16 },
|
|
398
|
+
{ paddingVertical: 16, marginTop: insets.top },
|
|
408
399
|
]}
|
|
409
400
|
>
|
|
410
401
|
<MButton
|
|
@@ -436,7 +427,7 @@ export default function VehicleCamera(props: any) {
|
|
|
436
427
|
>
|
|
437
428
|
{title}
|
|
438
429
|
</MText>
|
|
439
|
-
</
|
|
430
|
+
</View>
|
|
440
431
|
</View>
|
|
441
432
|
) : (
|
|
442
433
|
<View></View>
|
|
@@ -592,17 +583,17 @@ const $overlay: ViewStyle = {
|
|
|
592
583
|
|
|
593
584
|
const $darkOverlayTop: ViewStyle = {
|
|
594
585
|
width: '100%',
|
|
595
|
-
|
|
586
|
+
flex: 1,
|
|
596
587
|
backgroundColor: overlayColor,
|
|
597
588
|
};
|
|
598
589
|
|
|
599
590
|
const $darkOverlayBottom: ViewStyle = {
|
|
600
591
|
width: '100%',
|
|
601
|
-
|
|
592
|
+
flex: 1,
|
|
602
593
|
backgroundColor: overlayColor,
|
|
603
594
|
};
|
|
604
595
|
const $darkOverlaySide: ViewStyle = {
|
|
605
|
-
|
|
596
|
+
flex: 1,
|
|
606
597
|
height: frameHeight,
|
|
607
598
|
backgroundColor: overlayColor,
|
|
608
599
|
};
|
|
@@ -611,6 +602,13 @@ const $frameBorder: ViewStyle = {
|
|
|
611
602
|
height: frameHeight,
|
|
612
603
|
};
|
|
613
604
|
|
|
605
|
+
const $overlayRow: ViewStyle = {
|
|
606
|
+
width: '100%',
|
|
607
|
+
height: frameHeight,
|
|
608
|
+
flexDirection: 'row',
|
|
609
|
+
alignItems: 'center',
|
|
610
|
+
};
|
|
611
|
+
|
|
614
612
|
const $row: ViewStyle = {
|
|
615
613
|
flexDirection: 'row',
|
|
616
614
|
alignItems: 'center',
|