react-native-timacare 3.3.17 → 3.3.19
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/components/MHeader.js +1 -1
- package/lib/commonjs/components/MHeader.js.flow +1 -1
- package/lib/commonjs/screens/detail-loan/DetailLoanTima.js +1 -1
- package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.flow +117 -32
- package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js.flow +360 -21
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js.map +1 -1
- 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/components/MHeader.js +1 -1
- package/lib/module/screens/detail-loan/DetailLoanTima.js +1 -1
- package/lib/module/screens/detail-loan/DetailLoanTima.js.map +1 -1
- package/lib/module/screens/detail-loan/ShowQrCode.js +1 -1
- package/lib/module/screens/detail-loan/ShowQrCode.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/detail-loan/DetailLoanTima.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/ShowQrCode.d.ts.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/components/MHeader.tsx +1 -1
- package/src/screens/detail-loan/DetailLoanTima.tsx +117 -32
- package/src/screens/detail-loan/ShowQrCode.tsx +360 -21
- 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
|
@@ -29,8 +29,20 @@ import {
|
|
|
29
29
|
} from '../../assets/digital_topup';
|
|
30
30
|
import { color } from '../../theme';
|
|
31
31
|
import { ScreenNames } from '../../navigation';
|
|
32
|
-
import { Info } from '../../assets/icons';
|
|
32
|
+
import { Close2Icon, Info } from '../../assets/icons';
|
|
33
33
|
import { Api } from '../../services/api';
|
|
34
|
+
import {
|
|
35
|
+
Icon10,
|
|
36
|
+
Icon2,
|
|
37
|
+
Icon3,
|
|
38
|
+
Icon4,
|
|
39
|
+
Icon5,
|
|
40
|
+
Icon6,
|
|
41
|
+
Icon7,
|
|
42
|
+
Icon8,
|
|
43
|
+
Icon9,
|
|
44
|
+
IconSuccess,
|
|
45
|
+
} from '../../assets/v3';
|
|
34
46
|
|
|
35
47
|
interface IProps {
|
|
36
48
|
item?: any;
|
|
@@ -597,9 +609,9 @@ export default function DigitalTopupItem({
|
|
|
597
609
|
)}
|
|
598
610
|
</View>
|
|
599
611
|
<Modal
|
|
600
|
-
|
|
601
|
-
backdropColor=
|
|
602
|
-
backdropOpacity={
|
|
612
|
+
isVisible={showModalInfo}
|
|
613
|
+
backdropColor="#000"
|
|
614
|
+
backdropOpacity={0.5}
|
|
603
615
|
>
|
|
604
616
|
<View
|
|
605
617
|
style={{
|
|
@@ -715,6 +727,262 @@ export default function DigitalTopupItem({
|
|
|
715
727
|
</View>
|
|
716
728
|
</View>
|
|
717
729
|
</Modal>
|
|
730
|
+
|
|
731
|
+
<Modal
|
|
732
|
+
isVisible={showModal}
|
|
733
|
+
backdropColor="#000"
|
|
734
|
+
backdropOpacity={0.5}
|
|
735
|
+
onBackdropPress={() => setShowModal(false)}
|
|
736
|
+
>
|
|
737
|
+
<View
|
|
738
|
+
style={{
|
|
739
|
+
borderRadius: 12,
|
|
740
|
+
backgroundColor: 'white',
|
|
741
|
+
padding: 16,
|
|
742
|
+
}}
|
|
743
|
+
>
|
|
744
|
+
<MText
|
|
745
|
+
style={{
|
|
746
|
+
fontSize: 16,
|
|
747
|
+
fontWeight: 'bold',
|
|
748
|
+
textAlign: 'center',
|
|
749
|
+
marginTop: 16,
|
|
750
|
+
}}
|
|
751
|
+
>
|
|
752
|
+
Các bước hoàn thiện khoản vay
|
|
753
|
+
</MText>
|
|
754
|
+
<MText
|
|
755
|
+
style={{
|
|
756
|
+
textAlign: 'center',
|
|
757
|
+
color: '#828282',
|
|
758
|
+
}}
|
|
759
|
+
>
|
|
760
|
+
Thực hiện theo các bước sau
|
|
761
|
+
</MText>
|
|
762
|
+
<View>
|
|
763
|
+
<View
|
|
764
|
+
style={{
|
|
765
|
+
flexDirection: 'row',
|
|
766
|
+
alignItems: 'center',
|
|
767
|
+
gap: 8,
|
|
768
|
+
marginTop: 16,
|
|
769
|
+
}}
|
|
770
|
+
>
|
|
771
|
+
<View
|
|
772
|
+
style={{
|
|
773
|
+
width: 30,
|
|
774
|
+
height: 30,
|
|
775
|
+
borderRadius: 4,
|
|
776
|
+
backgroundColor: '#FFF2F2',
|
|
777
|
+
alignItems: 'center',
|
|
778
|
+
justifyContent: 'center',
|
|
779
|
+
}}
|
|
780
|
+
>
|
|
781
|
+
<Icon2 />
|
|
782
|
+
</View>
|
|
783
|
+
<View>
|
|
784
|
+
<MText
|
|
785
|
+
style={{ fontWeight: 'bold', fontSize: 8, color: '#EF592E' }}
|
|
786
|
+
>
|
|
787
|
+
Bước 1
|
|
788
|
+
</MText>
|
|
789
|
+
<MText style={{ fontWeight: 'bold', fontSize: 10 }}>
|
|
790
|
+
THÔNG TIN KHOẢN VAY
|
|
791
|
+
</MText>
|
|
792
|
+
</View>
|
|
793
|
+
</View>
|
|
794
|
+
<MText style={{ fontSize: 10, marginTop: 5 }}>
|
|
795
|
+
Nhập thông tin: Số tiền vay, Thời hạn vay, ...
|
|
796
|
+
</MText>
|
|
797
|
+
</View>
|
|
798
|
+
<View>
|
|
799
|
+
<View
|
|
800
|
+
style={{
|
|
801
|
+
flexDirection: 'row',
|
|
802
|
+
alignItems: 'center',
|
|
803
|
+
gap: 8,
|
|
804
|
+
marginTop: 16,
|
|
805
|
+
}}
|
|
806
|
+
>
|
|
807
|
+
<View
|
|
808
|
+
style={{
|
|
809
|
+
width: 30,
|
|
810
|
+
height: 30,
|
|
811
|
+
borderRadius: 4,
|
|
812
|
+
backgroundColor: '#FFF2F2',
|
|
813
|
+
alignItems: 'center',
|
|
814
|
+
justifyContent: 'center',
|
|
815
|
+
}}
|
|
816
|
+
>
|
|
817
|
+
<Icon3 />
|
|
818
|
+
</View>
|
|
819
|
+
<View>
|
|
820
|
+
<MText
|
|
821
|
+
style={{ fontWeight: 'bold', fontSize: 8, color: '#EF592E' }}
|
|
822
|
+
>
|
|
823
|
+
Bước 2
|
|
824
|
+
</MText>
|
|
825
|
+
<MText style={{ fontWeight: 'bold', fontSize: 10 }}>
|
|
826
|
+
THÔNG TIN CÁ NHÂN
|
|
827
|
+
</MText>
|
|
828
|
+
</View>
|
|
829
|
+
</View>
|
|
830
|
+
<MText style={{ fontSize: 10, marginTop: 5 }}>
|
|
831
|
+
Thực hiện NFC/ OCR giấy tờ CCCD/CC và chụp 1 ảnh chân dung
|
|
832
|
+
</MText>
|
|
833
|
+
</View>
|
|
834
|
+
<View>
|
|
835
|
+
<View
|
|
836
|
+
style={{
|
|
837
|
+
flexDirection: 'row',
|
|
838
|
+
alignItems: 'center',
|
|
839
|
+
gap: 8,
|
|
840
|
+
marginTop: 16,
|
|
841
|
+
}}
|
|
842
|
+
>
|
|
843
|
+
<View
|
|
844
|
+
style={{
|
|
845
|
+
width: 30,
|
|
846
|
+
height: 30,
|
|
847
|
+
borderRadius: 4,
|
|
848
|
+
backgroundColor: '#FFF2F2',
|
|
849
|
+
alignItems: 'center',
|
|
850
|
+
justifyContent: 'center',
|
|
851
|
+
}}
|
|
852
|
+
>
|
|
853
|
+
<Icon4 />
|
|
854
|
+
</View>
|
|
855
|
+
<View>
|
|
856
|
+
<MText
|
|
857
|
+
style={{ fontWeight: 'bold', fontSize: 8, color: '#EF592E' }}
|
|
858
|
+
>
|
|
859
|
+
Bước 3
|
|
860
|
+
</MText>
|
|
861
|
+
<MText style={{ fontWeight: 'bold', fontSize: 10 }}>EKYC</MText>
|
|
862
|
+
</View>
|
|
863
|
+
</View>
|
|
864
|
+
<MText style={{ fontSize: 10, marginTop: 5 }}>
|
|
865
|
+
Thực hiện eKYC khuôn mặt
|
|
866
|
+
</MText>
|
|
867
|
+
</View>
|
|
868
|
+
<View>
|
|
869
|
+
<View
|
|
870
|
+
style={{
|
|
871
|
+
flexDirection: 'row',
|
|
872
|
+
alignItems: 'center',
|
|
873
|
+
gap: 8,
|
|
874
|
+
marginTop: 16,
|
|
875
|
+
}}
|
|
876
|
+
>
|
|
877
|
+
<View
|
|
878
|
+
style={{
|
|
879
|
+
width: 30,
|
|
880
|
+
height: 30,
|
|
881
|
+
borderRadius: 4,
|
|
882
|
+
backgroundColor: '#FFF2F2',
|
|
883
|
+
alignItems: 'center',
|
|
884
|
+
justifyContent: 'center',
|
|
885
|
+
}}
|
|
886
|
+
>
|
|
887
|
+
<Icon5 />
|
|
888
|
+
</View>
|
|
889
|
+
<View>
|
|
890
|
+
<MText
|
|
891
|
+
style={{ fontWeight: 'bold', fontSize: 8, color: '#EF592E' }}
|
|
892
|
+
>
|
|
893
|
+
Bước 4
|
|
894
|
+
</MText>
|
|
895
|
+
<MText style={{ fontWeight: 'bold', fontSize: 10 }}>
|
|
896
|
+
KÝ HỢP ĐỒNG
|
|
897
|
+
</MText>
|
|
898
|
+
</View>
|
|
899
|
+
</View>
|
|
900
|
+
<MText style={{ fontSize: 10, marginTop: 5 }}>
|
|
901
|
+
Ký số bằng OTP hoặc qua Ứng dụng Mysign
|
|
902
|
+
</MText>
|
|
903
|
+
<MText style={{ fontSize: 10, color: '#999999' }}>
|
|
904
|
+
Lưu ý: Để bảo mật thông tin cá nhân, hợp đồng sẽ được ký tại
|
|
905
|
+
Viettel qua Ứng dụng MySign, Website hopdongdientu.viettel.vn,...
|
|
906
|
+
</MText>
|
|
907
|
+
</View>
|
|
908
|
+
<View
|
|
909
|
+
style={{
|
|
910
|
+
backgroundColor: '#FFF8F2',
|
|
911
|
+
padding: 12,
|
|
912
|
+
borderRadius: 8,
|
|
913
|
+
marginTop: 16,
|
|
914
|
+
}}
|
|
915
|
+
>
|
|
916
|
+
<MText style={{ fontSize: 12, fontWeight: 'bold' }}>
|
|
917
|
+
Ý nghĩa biểu tượng
|
|
918
|
+
</MText>
|
|
919
|
+
<View
|
|
920
|
+
style={{
|
|
921
|
+
flexDirection: 'row',
|
|
922
|
+
alignItems: 'center',
|
|
923
|
+
gap: 16,
|
|
924
|
+
marginTop: 8,
|
|
925
|
+
}}
|
|
926
|
+
>
|
|
927
|
+
<MText style={{ fontSize: 10, width: '35%' }}>
|
|
928
|
+
Đang cần thực hiện
|
|
929
|
+
</MText>
|
|
930
|
+
<View
|
|
931
|
+
style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}
|
|
932
|
+
>
|
|
933
|
+
<Icon2 />
|
|
934
|
+
<Icon3 />
|
|
935
|
+
<Icon4 />
|
|
936
|
+
<Icon5 />
|
|
937
|
+
</View>
|
|
938
|
+
</View>
|
|
939
|
+
<View
|
|
940
|
+
style={{
|
|
941
|
+
flexDirection: 'row',
|
|
942
|
+
alignItems: 'center',
|
|
943
|
+
gap: 16,
|
|
944
|
+
marginTop: 8,
|
|
945
|
+
}}
|
|
946
|
+
>
|
|
947
|
+
<MText style={{ fontSize: 10, width: '35%' }}>
|
|
948
|
+
Chưa thể thực hiện
|
|
949
|
+
</MText>
|
|
950
|
+
<View
|
|
951
|
+
style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}
|
|
952
|
+
>
|
|
953
|
+
<Icon7 />
|
|
954
|
+
<Icon8 />
|
|
955
|
+
<Icon9 />
|
|
956
|
+
<Icon10 />
|
|
957
|
+
</View>
|
|
958
|
+
</View>
|
|
959
|
+
<View
|
|
960
|
+
style={{
|
|
961
|
+
flexDirection: 'row',
|
|
962
|
+
alignItems: 'center',
|
|
963
|
+
gap: 16,
|
|
964
|
+
marginTop: 8,
|
|
965
|
+
}}
|
|
966
|
+
>
|
|
967
|
+
<MText style={{ fontSize: 10, width: '35%' }}>
|
|
968
|
+
Đã hoàn thành
|
|
969
|
+
</MText>
|
|
970
|
+
<View
|
|
971
|
+
style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}
|
|
972
|
+
>
|
|
973
|
+
<IconSuccess />
|
|
974
|
+
</View>
|
|
975
|
+
</View>
|
|
976
|
+
</View>
|
|
977
|
+
|
|
978
|
+
<TouchableOpacity
|
|
979
|
+
style={{ position: 'absolute', top: 16, right: 16 }}
|
|
980
|
+
onPress={() => setShowModal(false)}
|
|
981
|
+
>
|
|
982
|
+
<Close2Icon />
|
|
983
|
+
</TouchableOpacity>
|
|
984
|
+
</View>
|
|
985
|
+
</Modal>
|
|
718
986
|
</>
|
|
719
987
|
);
|
|
720
988
|
}
|
|
@@ -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',
|