react-native-timacare 3.1.12-beta → 3.1.14-beta

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.
Files changed (136) hide show
  1. package/lib/commonjs/assets/svgs/ekyc_disable.svg +4 -0
  2. package/lib/commonjs/assets/svgs/expand.svg +8 -0
  3. package/lib/commonjs/assets/svgs/expand_up.svg +8 -0
  4. package/lib/commonjs/assets/svgs/index.js +1 -1
  5. package/lib/commonjs/assets/svgs/index.js.flow +14 -0
  6. package/lib/commonjs/assets/svgs/index.js.map +1 -1
  7. package/lib/commonjs/assets/svgs/money.svg +5 -0
  8. package/lib/commonjs/assets/svgs/sign_disable.svg +12 -0
  9. package/lib/commonjs/assets/svgs/sign_success.svg +12 -0
  10. package/lib/commonjs/assets/svgs/tima_16.svg +13 -0
  11. package/lib/commonjs/screens/home/index.js +1 -1
  12. package/lib/commonjs/screens/home/index.js.flow +2051 -1628
  13. package/lib/commonjs/screens/home/index.js.map +1 -1
  14. package/lib/commonjs/screens/liveness-v2/index.js +1 -1
  15. package/lib/commonjs/screens/liveness-v2/index.js.flow +10 -6
  16. package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
  17. package/lib/commonjs/screens/register/index.js +1 -1
  18. package/lib/commonjs/screens/register/index.js.flow +1 -1
  19. package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js +1 -1
  20. package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js.flow +123 -36
  21. package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js.map +1 -1
  22. package/lib/commonjs/screens/toan-trinh-so/OCR.js +1 -1
  23. package/lib/commonjs/screens/toan-trinh-so/OCR.js.flow +3 -1
  24. package/lib/commonjs/screens/toan-trinh-so/OCR.js.map +1 -1
  25. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
  26. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +3 -1
  27. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  28. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js +1 -1
  29. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.flow +539 -483
  30. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
  31. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  32. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.flow +76 -57
  33. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  34. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js +1 -1
  35. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.flow +58 -12
  36. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  37. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js +1 -1
  38. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.flow +6 -7
  39. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.map +1 -1
  40. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js +1 -1
  41. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.flow +185 -50
  42. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
  43. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js +1 -1
  44. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.flow +4 -1
  45. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
  46. package/lib/commonjs/screens/toan-trinh-so/store.js +1 -1
  47. package/lib/commonjs/screens/toan-trinh-so/store.js.flow +23 -1
  48. package/lib/commonjs/screens/toan-trinh-so/store.js.map +1 -1
  49. package/lib/commonjs/services/api/api.js +1 -1
  50. package/lib/commonjs/services/api/api.js.flow +46 -0
  51. package/lib/commonjs/services/api/api.js.map +1 -1
  52. package/lib/commonjs/utils/index.js +1 -1
  53. package/lib/commonjs/utils/index.js.flow +51 -0
  54. package/lib/commonjs/utils/index.js.map +1 -1
  55. package/lib/module/assets/svgs/ekyc_disable.svg +4 -0
  56. package/lib/module/assets/svgs/expand.svg +8 -0
  57. package/lib/module/assets/svgs/expand_up.svg +8 -0
  58. package/lib/module/assets/svgs/index.js +1 -1
  59. package/lib/module/assets/svgs/index.js.map +1 -1
  60. package/lib/module/assets/svgs/money.svg +5 -0
  61. package/lib/module/assets/svgs/sign_disable.svg +12 -0
  62. package/lib/module/assets/svgs/sign_success.svg +12 -0
  63. package/lib/module/assets/svgs/tima_16.svg +13 -0
  64. package/lib/module/screens/home/index.js +1 -1
  65. package/lib/module/screens/home/index.js.map +1 -1
  66. package/lib/module/screens/liveness-v2/index.js +1 -1
  67. package/lib/module/screens/liveness-v2/index.js.map +1 -1
  68. package/lib/module/screens/register/index.js +1 -1
  69. package/lib/module/screens/toan-trinh-so/LoanInterestRate.js +1 -1
  70. package/lib/module/screens/toan-trinh-so/LoanInterestRate.js.map +1 -1
  71. package/lib/module/screens/toan-trinh-so/OCR.js +1 -1
  72. package/lib/module/screens/toan-trinh-so/OCR.js.map +1 -1
  73. package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
  74. package/lib/module/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  75. package/lib/module/screens/toan-trinh-so/ReviewInformation.js +1 -1
  76. package/lib/module/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
  77. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  78. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  79. package/lib/module/screens/toan-trinh-so/ReviewLoan.js +1 -1
  80. package/lib/module/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  81. package/lib/module/screens/toan-trinh-so/TTSOTP.js +1 -1
  82. package/lib/module/screens/toan-trinh-so/TTSOTP.js.map +1 -1
  83. package/lib/module/screens/toan-trinh-so/TTSSignLoan.js +1 -1
  84. package/lib/module/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
  85. package/lib/module/screens/toan-trinh-so/VehicleCamera.js +1 -1
  86. package/lib/module/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
  87. package/lib/module/screens/toan-trinh-so/store.js +1 -1
  88. package/lib/module/screens/toan-trinh-so/store.js.map +1 -1
  89. package/lib/module/services/api/api.js +1 -1
  90. package/lib/module/services/api/api.js.map +1 -1
  91. package/lib/module/utils/index.js +1 -1
  92. package/lib/module/utils/index.js.map +1 -1
  93. package/lib/typescript/assets/svgs/index.d.ts +8 -1
  94. package/lib/typescript/assets/svgs/index.d.ts.map +1 -1
  95. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  96. package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
  97. package/lib/typescript/screens/toan-trinh-so/LoanInterestRate.d.ts.map +1 -1
  98. package/lib/typescript/screens/toan-trinh-so/OCR.d.ts.map +1 -1
  99. package/lib/typescript/screens/toan-trinh-so/RegisterCamera.d.ts.map +1 -1
  100. package/lib/typescript/screens/toan-trinh-so/ReviewInformation.d.ts.map +1 -1
  101. package/lib/typescript/screens/toan-trinh-so/ReviewInformationOther.d.ts.map +1 -1
  102. package/lib/typescript/screens/toan-trinh-so/ReviewLoan.d.ts.map +1 -1
  103. package/lib/typescript/screens/toan-trinh-so/TTSOTP.d.ts +1 -1
  104. package/lib/typescript/screens/toan-trinh-so/TTSOTP.d.ts.map +1 -1
  105. package/lib/typescript/screens/toan-trinh-so/TTSSignLoan.d.ts.map +1 -1
  106. package/lib/typescript/screens/toan-trinh-so/VehicleCamera.d.ts.map +1 -1
  107. package/lib/typescript/screens/toan-trinh-so/store.d.ts +2 -0
  108. package/lib/typescript/screens/toan-trinh-so/store.d.ts.map +1 -1
  109. package/lib/typescript/services/api/api.d.ts +48 -0
  110. package/lib/typescript/services/api/api.d.ts.map +1 -1
  111. package/lib/typescript/utils/index.d.ts +8 -0
  112. package/lib/typescript/utils/index.d.ts.map +1 -1
  113. package/package.json +1 -1
  114. package/src/assets/svgs/ekyc_disable.svg +4 -0
  115. package/src/assets/svgs/expand.svg +8 -0
  116. package/src/assets/svgs/expand_up.svg +8 -0
  117. package/src/assets/svgs/index.tsx +14 -0
  118. package/src/assets/svgs/money.svg +5 -0
  119. package/src/assets/svgs/sign_disable.svg +12 -0
  120. package/src/assets/svgs/sign_success.svg +12 -0
  121. package/src/assets/svgs/tima_16.svg +13 -0
  122. package/src/screens/home/index.tsx +2051 -1628
  123. package/src/screens/liveness-v2/index.tsx +10 -6
  124. package/src/screens/register/index.tsx +1 -1
  125. package/src/screens/toan-trinh-so/LoanInterestRate.tsx +123 -36
  126. package/src/screens/toan-trinh-so/OCR.tsx +3 -1
  127. package/src/screens/toan-trinh-so/RegisterCamera.tsx +3 -1
  128. package/src/screens/toan-trinh-so/ReviewInformation.tsx +539 -483
  129. package/src/screens/toan-trinh-so/ReviewInformationOther.tsx +76 -57
  130. package/src/screens/toan-trinh-so/ReviewLoan.tsx +58 -12
  131. package/src/screens/toan-trinh-so/TTSOTP.tsx +6 -7
  132. package/src/screens/toan-trinh-so/TTSSignLoan.tsx +185 -50
  133. package/src/screens/toan-trinh-so/VehicleCamera.tsx +4 -1
  134. package/src/screens/toan-trinh-so/store.ts +23 -1
  135. package/src/services/api/api.ts +46 -0
  136. package/src/utils/index.tsx +51 -0
@@ -1,5 +1,5 @@
1
1
  //@ts-nocheck
2
- import React, { useEffect, useRef, useState } from 'react';
2
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import {
4
4
  Alert,
5
5
  ScrollView,
@@ -328,7 +328,7 @@ export default function ReviewInformation(props) {
328
328
  nationalCard: yup.string().required('Vui lòng nhập CCCD/CMND'),
329
329
  dateNationalId: yup
330
330
  .string()
331
- .required('Vui lòng nhập cấp')
331
+ .required('Vui lòng nhập ngày cấp')
332
332
  .nullable(),
333
333
  phone: yup
334
334
  .string()
@@ -354,89 +354,141 @@ export default function ReviewInformation(props) {
354
354
  handleChange,
355
355
  handleSubmit,
356
356
  setFieldValue,
357
- }) => (
358
- <ScrollView
359
- style={[commonStyles.fill, { paddingHorizontal: 16 }]}
360
- >
361
- <MText style={$title2}>1.1 Thông tin nhân</MText>
362
- <MText style={$label}>Họ và tên</MText>
363
- <TextInput
364
- style={[
365
- $textInput,
366
- {
367
- color: '#333333',
368
- fontSize: 16,
369
- fontWeight: '500',
370
- fontFamily: 'Be Vietnam Pro Medium',
371
- },
372
- ]}
373
- value={values.fullName}
374
- onChangeText={handleChange('fullName')}
375
- />
376
- {errors && errors.fullName && (
377
- <MText style={$error}>{errors.fullName}</MText>
378
- )}
379
- <View style={[$row, { marginTop: 16 }]}>
380
- <View style={[commonStyles.fill]}>
381
- <MText style={$label}>Sinh ngày</MText>
382
- <TouchableOpacity
383
- style={$select}
384
- onPress={() => {
385
- setTypeDate(1);
386
- setShowDate(true);
387
- }}
388
- >
389
- <MText
390
- style={{
357
+ }) => {
358
+ const renderView = useMemo(
359
+ () => (
360
+ <ScrollView
361
+ style={[commonStyles.fill, { paddingHorizontal: 16 }]}
362
+ >
363
+ <MText style={$title2}>1.1 Thông tin cá nhân</MText>
364
+ <MText style={$label}>Họ và tên</MText>
365
+ <TextInput
366
+ style={[
367
+ $textInput,
368
+ {
391
369
  color: '#333333',
392
370
  fontSize: 16,
393
371
  fontWeight: '500',
394
372
  fontFamily: 'Be Vietnam Pro Medium',
395
- }}
396
- >
397
- {values.dob}
398
- </MText>
399
- </TouchableOpacity>
400
- {errors && errors.dob && (
401
- <MText style={$error}>{errors.dob}</MText>
402
- )}
403
- </View>
404
- <View style={[commonStyles.fill]}>
405
- <MText style={$label}>Giới tính</MText>
406
- <TouchableOpacity
407
- style={$select}
408
- onPress={() => {
409
- navigation.push(ScreenNames.MSelect, {
410
- title: 'Chọn giới tính',
411
- data: EnumGender,
412
- callback: (item) => {
413
- setFieldValue('gender', item.id);
414
- },
415
- });
416
- }}
417
- >
418
- <MText
419
- style={{
420
- color: '#333333',
421
- fontSize: 16,
422
- fontWeight: '500',
423
- flex: 1,
424
- }}
425
- >
426
- {values.gender === 0 ? 'Nam' : 'Nữ'}
427
- </MText>
428
- <DropDown2 />
429
- </TouchableOpacity>
430
- {errors && errors.gender && (
431
- <MText style={$error}>{errors.gender}</MText>
373
+ },
374
+ ]}
375
+ value={values.fullName}
376
+ onChangeText={handleChange('fullName')}
377
+ />
378
+ {errors && errors.fullName && (
379
+ <MText style={$error}>{errors.fullName}</MText>
432
380
  )}
433
- </View>
434
- </View>
381
+ <View style={[$row, { marginTop: 16 }]}>
382
+ <View style={[commonStyles.fill]}>
383
+ <MText style={$label}>Sinh ngày</MText>
384
+ <TouchableOpacity
385
+ style={$select}
386
+ onPress={() => {
387
+ setTypeDate(1);
388
+ setShowDate(true);
389
+ }}
390
+ >
391
+ <MText
392
+ style={{
393
+ color: '#333333',
394
+ fontSize: 16,
395
+ fontWeight: '500',
396
+ fontFamily: 'Be Vietnam Pro Medium',
397
+ }}
398
+ >
399
+ {values.dob}
400
+ </MText>
401
+ </TouchableOpacity>
402
+ {errors && errors.dob && (
403
+ <MText style={$error}>{errors.dob}</MText>
404
+ )}
405
+ </View>
406
+ <View style={[commonStyles.fill]}>
407
+ <MText style={$label}>Giới tính</MText>
408
+ <TouchableOpacity
409
+ style={$select}
410
+ onPress={() => {
411
+ navigation.push(ScreenNames.MSelect, {
412
+ title: 'Chọn giới tính',
413
+ data: EnumGender,
414
+ callback: (item) => {
415
+ setFieldValue('gender', item.id);
416
+ },
417
+ });
418
+ }}
419
+ >
420
+ <MText
421
+ style={{
422
+ color: '#333333',
423
+ fontSize: 16,
424
+ fontWeight: '500',
425
+ flex: 1,
426
+ }}
427
+ >
428
+ {values.gender === 0 ? 'Nam' : 'Nữ'}
429
+ </MText>
430
+ <DropDown2 />
431
+ </TouchableOpacity>
432
+ {errors && errors.gender && (
433
+ <MText style={$error}>{errors.gender}</MText>
434
+ )}
435
+ </View>
436
+ </View>
435
437
 
436
- <View style={[$row]}>
437
- <View style={[commonStyles.fill]}>
438
- <MText style={$label}>Số CCCD/CMND</MText>
438
+ <View style={[$row]}>
439
+ <View style={[commonStyles.fill]}>
440
+ <MText style={$label}>Số CCCD/CMND</MText>
441
+ <TextInput
442
+ keyboardType="number-pad"
443
+ style={[
444
+ $textInput,
445
+ {
446
+ color: '#333333',
447
+ fontSize: 16,
448
+ fontWeight: '500',
449
+ },
450
+ ]}
451
+ value={values.nationalCard}
452
+ onChangeText={handleChange('nationalCard')}
453
+ />
454
+ {errors && errors.nationalCard && (
455
+ <MText style={$error}>{errors.nationalCard}</MText>
456
+ )}
457
+ </View>
458
+ <View style={[commonStyles.fill]}>
459
+ <MText style={$label}>Ngày cấp</MText>
460
+ <TouchableOpacity
461
+ style={$select}
462
+ onPress={() => {
463
+ setTypeDate(2);
464
+ setShowDate(true);
465
+ }}
466
+ >
467
+ <MText
468
+ numberOfLines={1}
469
+ style={{
470
+ color:
471
+ values.dateNationalId !== ''
472
+ ? '#333333'
473
+ : '#BDBDBD',
474
+ fontSize: 16,
475
+ fontWeight: '500',
476
+ flex: 1,
477
+ }}
478
+ >
479
+ {values.dateNationalId !== ''
480
+ ? values.dateNationalId
481
+ : 'DD/MM/YYYY'}
482
+ </MText>
483
+ </TouchableOpacity>
484
+ {errors && errors.dateNationalId && (
485
+ <MText style={$error}>{errors.dateNationalId}</MText>
486
+ )}
487
+ </View>
488
+ </View>
489
+ <MText style={$label}>Số điện thoại</MText>
439
490
  <TextInput
491
+ editable={false}
440
492
  keyboardType="number-pad"
441
493
  style={[
442
494
  $textInput,
@@ -446,94 +498,128 @@ export default function ReviewInformation(props) {
446
498
  fontWeight: '500',
447
499
  },
448
500
  ]}
449
- value={values.nationalCard}
450
- onChangeText={handleChange('nationalCard')}
501
+ value={values.phone}
502
+ onChangeText={handleChange('phone')}
451
503
  />
452
- {errors && errors.nationalCard && (
453
- <MText style={$error}>{errors.nationalCard}</MText>
504
+ {errors && errors.phone && (
505
+ <MText style={$error}>{errors.phone}</MText>
454
506
  )}
455
- </View>
456
- <View style={[commonStyles.fill]}>
457
- <MText style={$label}>Ngày cấp</MText>
458
- <TouchableOpacity
459
- style={$select}
460
- onPress={() => {
461
- setTypeDate(2);
462
- setShowDate(true);
463
- }}
464
- >
465
- <MText
466
- numberOfLines={1}
467
- style={{
507
+
508
+ {/* <MText style={[$label, { marginTop: 16 }]}>Hộ chiếu</MText>
509
+ <TextInput
510
+ placeholder="Nhập hộ chiếu của bạn"
511
+ placeholderTextColor={'#BDBDBD'}
512
+ style={[
513
+ $textInput,
514
+ {
468
515
  color: '#333333',
469
516
  fontSize: 16,
470
517
  fontWeight: '500',
471
- flex: 1,
472
- }}
473
- >
474
- {values.dateNationalId}
475
- </MText>
476
- </TouchableOpacity>
477
- {errors && errors.dateNationalId && (
478
- <MText style={$error}>{errors.dateNationalId}</MText>
479
- )}
480
- </View>
481
- </View>
482
- <MText style={$label}>Số điện thoại</MText>
483
- <TextInput
484
- editable={false}
485
- keyboardType="number-pad"
486
- style={[
487
- $textInput,
488
- {
489
- color: '#333333',
490
- fontSize: 16,
491
- fontWeight: '500',
492
- },
493
- ]}
494
- value={values.phone}
495
- onChangeText={handleChange('phone')}
496
- />
497
- {errors && errors.phone && (
498
- <MText style={$error}>{errors.phone}</MText>
499
- )}
500
-
501
- <MText style={[$label, { marginTop: 16 }]}>Hộ chiếu</MText>
502
- <TextInput
503
- placeholder="Nhập hộ chiếu của bạn"
504
- placeholderTextColor={'#BDBDBD'}
505
- style={[
506
- $textInput,
507
- {
508
- color: '#333333',
509
- fontSize: 16,
510
- fontWeight: '500',
511
- },
512
- ]}
513
- value={values.passport}
514
- onChangeText={handleChange('passport')}
515
- />
518
+ },
519
+ ]}
520
+ value={values.passport}
521
+ onChangeText={handleChange('passport')}
522
+ /> */}
516
523
 
517
- <MText style={[$title2, { marginTop: 16 }]}>
518
- 1.2 Sổ hộ khẩu
519
- </MText>
520
- <View style={[$row]}>
521
- <View style={[commonStyles.fill]}>
522
- <MText style={$label}>Tỉnh/ Thành phố</MText>
524
+ <MText style={[$title2, { marginTop: 16 }]}>
525
+ 1.2 Sổ hộ khẩu
526
+ </MText>
527
+ <View style={[$row]}>
528
+ <View style={[commonStyles.fill]}>
529
+ <MText style={$label}>Tỉnh/ Thành phố</MText>
530
+ <TouchableOpacity
531
+ style={$select}
532
+ onPress={() => {
533
+ navigation.push(ScreenNames.CommonSelect, {
534
+ title: 'Tỉnh/ Thành phố',
535
+ data: ttsStore.listProvince,
536
+ callback: (item) => {
537
+ setFieldValue('houseHoldProvinceId', item.id);
538
+ setFieldValue(
539
+ 'houseHoldProvinceName',
540
+ item.name
541
+ );
542
+ setFieldValue('houseHoldDistrictId', null);
543
+ setFieldValue('houseHoldDistrictName', '');
544
+ setFieldValue('houseHoldWardId', null);
545
+ setFieldValue('houseHoldWardName', '');
546
+ ttsStore.getDistrict2(item.id);
547
+ },
548
+ });
549
+ }}
550
+ >
551
+ <MText
552
+ numberOfLines={1}
553
+ style={{
554
+ color: '#333333',
555
+ fontSize: 16,
556
+ fontWeight: '500',
557
+ flex: 1,
558
+ fontFamily: 'Be Vietnam Pro Medium',
559
+ }}
560
+ >
561
+ {values.houseHoldProvinceName}
562
+ </MText>
563
+ <DropDown2 />
564
+ </TouchableOpacity>
565
+ {errors && errors.houseHoldProvinceName && (
566
+ <MText style={$error}>
567
+ {errors.houseHoldProvinceName}
568
+ </MText>
569
+ )}
570
+ </View>
571
+ <View style={[commonStyles.fill]}>
572
+ <MText style={$label}>Quận/ Huyện</MText>
573
+ <TouchableOpacity
574
+ style={$select}
575
+ onPress={() => {
576
+ navigation.push(ScreenNames.CommonSelect, {
577
+ title: 'Phường/ Xã',
578
+ data: ttsStore.listDistrict2,
579
+ callback: (item) => {
580
+ setFieldValue('houseHoldDistrictId', item.id);
581
+ setFieldValue(
582
+ 'houseHoldDistrictName',
583
+ item.name
584
+ );
585
+ setFieldValue('houseHoldWardId', null);
586
+ setFieldValue('houseHoldWardName', '');
587
+ ttsStore.getWard2(item.id);
588
+ },
589
+ });
590
+ }}
591
+ >
592
+ <MText
593
+ numberOfLines={1}
594
+ style={{
595
+ color: '#333333',
596
+ fontSize: 16,
597
+ fontWeight: '500',
598
+ flex: 1,
599
+ fontFamily: 'Be Vietnam Pro Medium',
600
+ }}
601
+ >
602
+ {values.houseHoldDistrictName}
603
+ </MText>
604
+ <DropDown2 />
605
+ </TouchableOpacity>
606
+ {errors && errors.houseHoldDistrictName && (
607
+ <MText style={$error}>
608
+ {errors.houseHoldDistrictName}
609
+ </MText>
610
+ )}
611
+ </View>
612
+ </View>
613
+ <MText style={[$label]}>Phường/ Xã</MText>
523
614
  <TouchableOpacity
524
615
  style={$select}
525
616
  onPress={() => {
526
617
  navigation.push(ScreenNames.CommonSelect, {
527
- title: 'Tỉnh/ Thành phố',
528
- data: ttsStore.listProvince,
618
+ title: 'Phường/ ',
619
+ data: ttsStore.listWard2,
529
620
  callback: (item) => {
530
- setFieldValue('houseHoldProvinceId', item.id);
531
- setFieldValue('houseHoldProvinceName', item.name);
532
- setFieldValue('houseHoldDistrictId', null);
533
- setFieldValue('houseHoldDistrictName', '');
534
- setFieldValue('houseHoldWardId', null);
535
- setFieldValue('houseHoldWardName', '');
536
- ttsStore.getDistrict2(item.id);
621
+ setFieldValue('houseHoldWardId', item?.id);
622
+ setFieldValue('houseHoldWardName', item?.name);
537
623
  },
538
624
  });
539
625
  }}
@@ -548,223 +634,254 @@ export default function ReviewInformation(props) {
548
634
  fontFamily: 'Be Vietnam Pro Medium',
549
635
  }}
550
636
  >
551
- {values.houseHoldProvinceName}
637
+ {values.houseHoldWardName}
552
638
  </MText>
553
639
  <DropDown2 />
554
640
  </TouchableOpacity>
555
- {errors && errors.houseHoldProvinceName && (
556
- <MText style={$error}>
557
- {errors.houseHoldProvinceName}
558
- </MText>
641
+ {errors && errors.houseHoldWardName && (
642
+ <MText style={$error}>{errors.houseHoldWardName}</MText>
559
643
  )}
560
- </View>
561
- <View style={[commonStyles.fill]}>
562
- <MText style={$label}>Quận/ Huyện</MText>
563
- <TouchableOpacity
564
- style={$select}
565
- onPress={() => {
566
- navigation.push(ScreenNames.CommonSelect, {
567
- title: 'Phường/ Xã',
568
- data: ttsStore.listDistrict2,
569
- callback: (item) => {
570
- setFieldValue('houseHoldDistrictId', item.id);
571
- setFieldValue('houseHoldDistrictName', item.name);
572
- setFieldValue('houseHoldWardId', null);
573
- setFieldValue('houseHoldWardName', '');
574
- ttsStore.getWard2(item.id);
575
- },
576
- });
577
- }}
578
- >
579
- <MText
580
- numberOfLines={1}
581
- style={{
644
+ <MText style={[$label, { marginTop: 16 }]}>
645
+ Địa chỉ chi tiết
646
+ </MText>
647
+ <TextInput
648
+ numberOfLines={1}
649
+ style={[
650
+ $textInput,
651
+ {
582
652
  color: '#333333',
583
653
  fontSize: 16,
584
654
  fontWeight: '500',
585
- flex: 1,
586
- fontFamily: 'Be Vietnam Pro Medium',
655
+ },
656
+ ]}
657
+ value={values.houseHoldAddress}
658
+ onChangeText={handleChange('houseHoldAddress')}
659
+ />
660
+ {errors && errors.houseHoldAddress && (
661
+ <MText style={$error}>{errors.houseHoldAddress}</MText>
662
+ )}
663
+ <View style={[$row, { marginTop: 16 }]}>
664
+ <MText
665
+ style={{
666
+ fontSize: 14,
667
+ color: '#333333',
587
668
  }}
588
669
  >
589
- {values.houseHoldDistrictName}
590
- </MText>
591
- <DropDown2 />
592
- </TouchableOpacity>
593
- {errors && errors.houseHoldDistrictName && (
594
- <MText style={$error}>
595
- {errors.houseHoldDistrictName}
670
+ A/C đã có gia đình chưa
596
671
  </MText>
597
- )}
598
- </View>
599
- </View>
600
- <MText style={[$label]}>Phường/ Xã</MText>
601
- <TouchableOpacity
602
- style={$select}
603
- onPress={() => {
604
- navigation.push(ScreenNames.CommonSelect, {
605
- title: 'Phường/ Xã',
606
- data: ttsStore.listWard2,
607
- callback: (item) => {
608
- setFieldValue('houseHoldWardId', item?.id);
609
- setFieldValue('houseHoldWardName', item?.name);
610
- },
611
- });
612
- }}
613
- >
614
- <MText
615
- numberOfLines={1}
616
- style={{
617
- color: '#333333',
618
- fontSize: 16,
619
- fontWeight: '500',
620
- flex: 1,
621
- fontFamily: 'Be Vietnam Pro Medium',
622
- }}
623
- >
624
- {values.houseHoldWardName}
625
- </MText>
626
- <DropDown2 />
627
- </TouchableOpacity>
628
- {errors && errors.houseHoldWardName && (
629
- <MText style={$error}>{errors.houseHoldWardName}</MText>
630
- )}
631
- <MText style={[$label, { marginTop: 16 }]}>
632
- Địa chỉ chi tiết
633
- </MText>
634
- <TextInput
635
- numberOfLines={1}
636
- style={[
637
- $textInput,
638
- {
639
- color: '#333333',
640
- fontSize: 16,
641
- fontWeight: '500',
642
- },
643
- ]}
644
- value={values.houseHoldAddress}
645
- onChangeText={handleChange('houseHoldAddress')}
646
- />
647
- {errors && errors.houseHoldAddress && (
648
- <MText style={$error}>{errors.houseHoldAddress}</MText>
649
- )}
650
- <View style={[$row, { marginTop: 16 }]}>
651
- <MText
652
- style={{
653
- fontSize: 14,
654
- color: '#333333',
655
- }}
656
- >
657
- A/C đã có gia đình chưa
658
- </MText>
659
- <View
660
- style={{
661
- flex: 1,
662
- flexDirection: 'row',
663
- gap: 16,
664
- justifyContent: 'space-between',
665
- marginLeft: 24,
666
- }}
667
- >
668
- <TouchableOpacity
669
- onPress={() => setFieldValue('isMerried', 1)}
672
+ <View
673
+ style={{
674
+ flex: 1,
675
+ flexDirection: 'row',
676
+ gap: 16,
677
+ justifyContent: 'space-between',
678
+ marginLeft: 24,
679
+ }}
680
+ >
681
+ <TouchableOpacity
682
+ onPress={() => setFieldValue('isMerried', 1)}
683
+ style={{
684
+ flexDirection: 'row',
685
+ gap: 5,
686
+ alignItems: 'center',
687
+ }}
688
+ >
689
+ {values.isMerried === 1 ? (
690
+ <RadioCheckIcon />
691
+ ) : (
692
+ <RadioIcon />
693
+ )}
694
+ <MText>Đã có</MText>
695
+ </TouchableOpacity>
696
+ <TouchableOpacity
697
+ onPress={() => setFieldValue('isMerried', 0)}
698
+ style={{
699
+ flexDirection: 'row',
700
+ gap: 5,
701
+ alignItems: 'center',
702
+ }}
703
+ >
704
+ {values.isMerried === 0 ? (
705
+ <RadioCheckIcon />
706
+ ) : (
707
+ <RadioIcon />
708
+ )}
709
+ <MText>Chưa có</MText>
710
+ </TouchableOpacity>
711
+ </View>
712
+ </View>
713
+ <MText style={[$title2]}>1.3 Nơi ở hiện tại</MText>
714
+ <MText
670
715
  style={{
671
- flexDirection: 'row',
672
- gap: 5,
673
- alignItems: 'center',
716
+ fontSize: 14,
717
+ color: '#333333',
674
718
  }}
675
719
  >
676
- {values.isMerried === 1 ? (
677
- <RadioCheckIcon />
678
- ) : (
679
- <RadioIcon />
680
- )}
681
- <MText>Đã có</MText>
682
- </TouchableOpacity>
683
- <TouchableOpacity
684
- onPress={() => setFieldValue('isMerried', 0)}
720
+ Nơi trùng với địa chỉ hộ khẩu không?
721
+ </MText>
722
+ <View
685
723
  style={{
724
+ flex: 1,
686
725
  flexDirection: 'row',
687
- gap: 5,
688
- alignItems: 'center',
726
+ gap: 16,
727
+ marginTop: 5,
689
728
  }}
690
729
  >
691
- {values.isMerried === 0 ? (
692
- <RadioCheckIcon />
693
- ) : (
694
- <RadioIcon />
695
- )}
696
- <MText>Chưa có</MText>
697
- </TouchableOpacity>
698
- </View>
699
- </View>
700
- <MText style={[$title2]}>1.3 Nơi ở hiện tại</MText>
701
- <MText
702
- style={{
703
- fontSize: 14,
704
- color: '#333333',
705
- }}
706
- >
707
- Nơi ở có trùng với địa chỉ hộ khẩu không?
708
- </MText>
709
- <View
710
- style={{
711
- flex: 1,
712
- flexDirection: 'row',
713
- gap: 16,
714
- marginTop: 5,
715
- }}
716
- >
717
- <TouchableOpacity
718
- onPress={() => setFieldValue('residentType', 14)}
719
- style={{
720
- flexDirection: 'row',
721
- gap: 5,
722
- alignItems: 'center',
723
- flex: 1,
724
- }}
725
- >
726
- {values.residentType === 14 ? (
727
- <RadioCheckIcon />
728
- ) : (
729
- <RadioIcon />
730
- )}
731
- <MText>Có trùng</MText>
732
- </TouchableOpacity>
733
- <TouchableOpacity
734
- onPress={() => setFieldValue('residentType', 15)}
735
- style={{
736
- flexDirection: 'row',
737
- gap: 5,
738
- alignItems: 'center',
739
- flex: 1,
740
- }}
741
- >
742
- {values.residentType === 15 ? (
743
- <RadioCheckIcon />
744
- ) : (
745
- <RadioIcon />
746
- )}
747
- <MText>Không trùng</MText>
748
- </TouchableOpacity>
749
- </View>
730
+ <TouchableOpacity
731
+ onPress={() => {
732
+ setFieldValue('residentType', 14);
733
+ setFieldValue(
734
+ 'provinceId',
735
+ values.houseHoldProvinceId
736
+ );
737
+ setFieldValue(
738
+ 'provinceName',
739
+ values.houseHoldProvinceName
740
+ );
741
+ setFieldValue(
742
+ 'districtId',
743
+ values.houseHoldDistrictId
744
+ );
745
+ setFieldValue(
746
+ 'districtName',
747
+ values.houseHoldDistrictName
748
+ );
749
+ setFieldValue('wardId', values.houseHoldWardId);
750
+ setFieldValue('wardName', values.houseHoldWardName);
751
+ if (values.houseHoldDistrictId) {
752
+ ttsStore.getWard(values.houseHoldDistrictId);
753
+ }
754
+ if (values.houseHoldProvinceId) {
755
+ ttsStore.getDistrict(values.houseHoldProvinceId);
756
+ }
757
+ setFieldValue('address', values.houseHoldAddress);
758
+ }}
759
+ style={{
760
+ flexDirection: 'row',
761
+ gap: 5,
762
+ alignItems: 'center',
763
+ flex: 1,
764
+ }}
765
+ >
766
+ {values.residentType === 14 ? (
767
+ <RadioCheckIcon />
768
+ ) : (
769
+ <RadioIcon />
770
+ )}
771
+ <MText>Có trùng</MText>
772
+ </TouchableOpacity>
773
+ <TouchableOpacity
774
+ onPress={() => {
775
+ setFieldValue('residentType', 15);
776
+ setFieldValue('provinceId', null);
777
+ setFieldValue('provinceName', '');
778
+ setFieldValue('districtId', null);
779
+ setFieldValue('districtName', '');
780
+ setFieldValue('wardId', null);
781
+ setFieldValue('wardName', '');
782
+ setFieldValue('address', '');
783
+ }}
784
+ style={{
785
+ flexDirection: 'row',
786
+ gap: 5,
787
+ alignItems: 'center',
788
+ flex: 1,
789
+ }}
790
+ >
791
+ {values.residentType === 15 ? (
792
+ <RadioCheckIcon />
793
+ ) : (
794
+ <RadioIcon />
795
+ )}
796
+ <MText>Không trùng</MText>
797
+ </TouchableOpacity>
798
+ </View>
750
799
 
751
- <View style={[$row, { marginTop: 16 }]}>
752
- <View style={[commonStyles.fill]}>
753
- <MText style={$label}>Tỉnh/ Thành phố</MText>
800
+ <View style={[$row, { marginTop: 16 }]}>
801
+ <View style={[commonStyles.fill]}>
802
+ <MText style={$label}>Tỉnh/ Thành phố</MText>
803
+ <TouchableOpacity
804
+ style={$select}
805
+ onPress={() => {
806
+ navigation.push(ScreenNames.CommonSelect, {
807
+ title: 'Tỉnh/ Thành phố',
808
+ data: ttsStore.listProvince,
809
+ callback: (item) => {
810
+ setFieldValue('provinceId', item.id);
811
+ setFieldValue('provinceName', item?.name);
812
+ setFieldValue('districtId', null);
813
+ setFieldValue('districtName', '');
814
+ setFieldValue('wardId', null);
815
+ setFieldValue('wardName', '');
816
+ ttsStore.getDistrict(item.id);
817
+ },
818
+ });
819
+ }}
820
+ >
821
+ <MText
822
+ numberOfLines={1}
823
+ style={{
824
+ color: '#333333',
825
+ fontSize: 16,
826
+ fontWeight: '500',
827
+ flex: 1,
828
+ fontFamily: 'Be Vietnam Pro Medium',
829
+ }}
830
+ >
831
+ {values.provinceName}
832
+ </MText>
833
+ <DropDown2 />
834
+ </TouchableOpacity>
835
+ {errors && errors.provinceName && (
836
+ <MText style={$error}>{errors.provinceName}</MText>
837
+ )}
838
+ </View>
839
+ <View style={[commonStyles.fill]}>
840
+ <MText style={$label}>Quận/ Huyện</MText>
841
+ <TouchableOpacity
842
+ style={$select}
843
+ onPress={() => {
844
+ navigation.push(ScreenNames.CommonSelect, {
845
+ title: 'Quận/ Huyện',
846
+ data: ttsStore.listDistrict,
847
+ callback: (item) => {
848
+ setFieldValue('districtId', item?.id);
849
+ setFieldValue('districtName', item?.name);
850
+ setFieldValue('wardId', null);
851
+ setFieldValue('wardName', '');
852
+ ttsStore.getWard(item.id);
853
+ },
854
+ });
855
+ }}
856
+ >
857
+ <MText
858
+ numberOfLines={1}
859
+ style={{
860
+ color: '#333333',
861
+ fontSize: 16,
862
+ fontWeight: '500',
863
+ flex: 1,
864
+ }}
865
+ >
866
+ {values.districtName}
867
+ </MText>
868
+ <DropDown2 />
869
+ </TouchableOpacity>
870
+ {errors && errors.districtName && (
871
+ <MText style={$error}>{errors.districtName}</MText>
872
+ )}
873
+ </View>
874
+ </View>
875
+ <MText style={[$label]}>Phường/ Xã</MText>
754
876
  <TouchableOpacity
755
877
  style={$select}
756
878
  onPress={() => {
757
879
  navigation.push(ScreenNames.CommonSelect, {
758
- title: 'Tỉnh/ Thành phố',
759
- data: ttsStore.listProvince,
880
+ title: 'Phường/ ',
881
+ data: ttsStore.listWard,
760
882
  callback: (item) => {
761
- setFieldValue('provinceId', item.id);
762
- setFieldValue('provinceName', item?.name);
763
- setFieldValue('districtId', null);
764
- setFieldValue('districtName', '');
765
- setFieldValue('wardId', null);
766
- setFieldValue('wardName', '');
767
- ttsStore.getDistrict(item.id);
883
+ setFieldValue('wardId', item.id);
884
+ setFieldValue('wardName', item?.name);
768
885
  },
769
886
  });
770
887
  }}
@@ -779,152 +896,91 @@ export default function ReviewInformation(props) {
779
896
  fontFamily: 'Be Vietnam Pro Medium',
780
897
  }}
781
898
  >
782
- {values.provinceName}
899
+ {values.wardName}
783
900
  </MText>
784
901
  <DropDown2 />
785
902
  </TouchableOpacity>
786
- {errors && errors.provinceName && (
787
- <MText style={$error}>{errors.provinceName}</MText>
903
+ {errors && errors.wardName && (
904
+ <MText style={$error}>{errors.wardName}</MText>
788
905
  )}
789
- </View>
790
- <View style={[commonStyles.fill]}>
791
- <MText style={$label}>Quận/ Huyện</MText>
792
- <TouchableOpacity
793
- style={$select}
906
+ <MText style={[$label, { marginTop: 16 }]}>
907
+ Địa chỉ chi tiết
908
+ </MText>
909
+ <TextInput
910
+ style={[
911
+ $textInput,
912
+ {
913
+ color: '#333333',
914
+ fontSize: 16,
915
+ fontWeight: '500',
916
+ },
917
+ ]}
918
+ value={values.address}
919
+ onChangeText={handleChange('address')}
920
+ />
921
+ {errors && errors.address && (
922
+ <MText style={$error}>{errors.address}</MText>
923
+ )}
924
+ <MButton
794
925
  onPress={() => {
795
- navigation.push(ScreenNames.CommonSelect, {
796
- title: 'Quận/ Huyện',
797
- data: ttsStore.listDistrict,
798
- callback: (item) => {
799
- setFieldValue('districtId', item?.id);
800
- setFieldValue('districtName', item?.name);
801
- setFieldValue('wardId', null);
802
- setFieldValue('wardName', '');
803
- ttsStore.getWard(item.id);
804
- },
805
- });
926
+ handleSubmit();
927
+ }}
928
+ style={{
929
+ marginVertical: 24,
806
930
  }}
807
931
  >
808
- <MText
809
- numberOfLines={1}
932
+ <LinearGradient
933
+ start={{ x: 1, y: 0 }}
934
+ end={{ x: 0, y: 1 }}
810
935
  style={{
811
- color: '#333333',
812
- fontSize: 16,
813
- fontWeight: '500',
814
- flex: 1,
936
+ height: 40,
937
+ marginVertical: 16,
938
+ borderRadius: 30,
939
+ alignItems: 'center',
940
+ justifyContent: 'center',
815
941
  }}
942
+ colors={['#FF7A00', '#EF4123']}
816
943
  >
817
- {values.districtName}
818
- </MText>
819
- <DropDown2 />
820
- </TouchableOpacity>
821
- {errors && errors.districtName && (
822
- <MText style={$error}>{errors.districtName}</MText>
823
- )}
824
- </View>
825
- </View>
826
- <MText style={[$label]}>Phường/ Xã</MText>
827
- <TouchableOpacity
828
- style={$select}
829
- onPress={() => {
830
- navigation.push(ScreenNames.CommonSelect, {
831
- title: 'Phường/ Xã',
832
- data: ttsStore.listWard,
833
- callback: (item) => {
834
- setFieldValue('wardId', item.id);
835
- setFieldValue('wardName', item?.name);
836
- },
837
- });
838
- }}
839
- >
840
- <MText
841
- numberOfLines={1}
842
- style={{
843
- color: '#333333',
844
- fontSize: 16,
845
- fontWeight: '500',
846
- flex: 1,
847
- fontFamily: 'Be Vietnam Pro Medium',
944
+ <MText
945
+ style={{
946
+ color: 'white',
947
+ fontSize: 16,
948
+ }}
949
+ >
950
+ Tiếp tục
951
+ </MText>
952
+ </LinearGradient>
953
+ </MButton>
954
+ </ScrollView>
955
+ ),
956
+ [values, errors]
957
+ );
958
+ return (
959
+ <>
960
+ {renderView}
961
+ <DatePicker
962
+ mode="date"
963
+ open={showDate}
964
+ modal
965
+ title="Chọn thời gian"
966
+ locale="vi"
967
+ date={new Date()}
968
+ onCancel={() => {
969
+ setShowDate(false);
848
970
  }}
849
- >
850
- {values.wardName}
851
- </MText>
852
- <DropDown2 />
853
- </TouchableOpacity>
854
- {errors && errors.wardName && (
855
- <MText style={$error}>{errors.wardName}</MText>
856
- )}
857
- <MText style={[$label, { marginTop: 16 }]}>
858
- Địa chỉ chi tiết
859
- </MText>
860
- <TextInput
861
- style={[
862
- $textInput,
863
- {
864
- color: '#333333',
865
- fontSize: 16,
866
- fontWeight: '500',
867
- },
868
- ]}
869
- value={values.address}
870
- onChangeText={handleChange('address')}
871
- />
872
- {errors && errors.address && (
873
- <MText style={$error}>{errors.address}</MText>
874
- )}
875
- <MButton
876
- onPress={() => {
877
- handleSubmit();
878
- }}
879
- style={{
880
- marginVertical: 24,
881
- }}
882
- >
883
- <LinearGradient
884
- start={{ x: 1, y: 0 }}
885
- end={{ x: 0, y: 1 }}
886
- style={{
887
- height: 40,
888
- marginVertical: 16,
889
- borderRadius: 30,
890
- alignItems: 'center',
891
- justifyContent: 'center',
971
+ onConfirm={(date) => {
972
+ setShowDate(false);
973
+ if (typeDate === 1) {
974
+ setFieldValue('dob', formatDDMMYYY(date));
975
+ }
976
+ if (typeDate === 2) {
977
+ setFieldValue('dateNationalId', formatDDMMYYY(date));
978
+ }
892
979
  }}
893
- colors={['#FF7A00', '#EF4123']}
894
- >
895
- <MText
896
- style={{
897
- color: 'white',
898
- fontSize: 16,
899
- }}
900
- >
901
- Tiếp tục
902
- </MText>
903
- </LinearGradient>
904
- </MButton>
905
-
906
- <DatePicker
907
- mode="date"
908
- open={showDate}
909
- modal
910
- title="Chọn thời gian"
911
- locale="vi"
912
- date={new Date()}
913
- onCancel={() => {
914
- setShowDate(false);
915
- }}
916
- onConfirm={(date) => {
917
- setShowDate(false);
918
- if (typeDate === 1) {
919
- setFieldValue('dob', formatDDMMYYY(date));
920
- }
921
- if (typeDate === 2) {
922
- setFieldValue('dateNationalId', formatDDMMYYY(date));
923
- }
924
- }}
925
- />
926
- </ScrollView>
927
- )}
980
+ />
981
+ </>
982
+ );
983
+ }}
928
984
  </Formik>
929
985
  <KeyboardSpacer />
930
986
  </View>