react-native-timacare 3.3.42 → 3.3.44

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 (92) hide show
  1. package/lib/commonjs/assets/icons/gui.svg +102 -0
  2. package/lib/commonjs/assets/icons/index.js +1 -1
  3. package/lib/commonjs/assets/icons/index.js.flow +6 -0
  4. package/lib/commonjs/assets/icons/index.js.map +1 -1
  5. package/lib/commonjs/assets/icons/layer1.svg +15 -0
  6. package/lib/commonjs/assets/icons/not_found.svg +135 -0
  7. package/lib/commonjs/components/SkeletonLoanCard.js +2 -0
  8. package/lib/commonjs/components/SkeletonLoanCard.js.flow +246 -0
  9. package/lib/commonjs/components/SkeletonLoanCard.js.map +1 -0
  10. package/lib/commonjs/index.js +1 -1
  11. package/lib/commonjs/index.js.flow +2 -1
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/navigation/index.js +1 -1
  14. package/lib/commonjs/navigation/index.js.flow +1 -0
  15. package/lib/commonjs/navigation/index.js.map +1 -1
  16. package/lib/commonjs/navigation/navigationRef.js +2 -0
  17. package/lib/commonjs/navigation/navigationRef.js.flow +40 -0
  18. package/lib/commonjs/navigation/navigationRef.js.map +1 -0
  19. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  20. package/lib/commonjs/navigation/primary-navigator.js.flow +30 -0
  21. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  22. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js +1 -1
  23. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.flow +1 -1
  24. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.map +1 -1
  25. package/lib/commonjs/screens/detail-loan/PaymentInfo.js +1 -1
  26. package/lib/commonjs/screens/detail-loan/PaymentInfo.js.flow +1 -0
  27. package/lib/commonjs/screens/detail-loan/PaymentInfo.js.map +1 -1
  28. package/lib/commonjs/screens/home/BoxGuidline.js +2 -0
  29. package/lib/commonjs/screens/home/BoxGuidline.js.flow +58 -0
  30. package/lib/commonjs/screens/home/BoxGuidline.js.map +1 -0
  31. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
  32. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +6 -5
  33. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.map +1 -1
  34. package/lib/commonjs/screens/home/index.js +1 -1
  35. package/lib/commonjs/screens/home/index.js.flow +211 -205
  36. package/lib/commonjs/screens/home/index.js.map +1 -1
  37. package/lib/module/assets/icons/gui.svg +102 -0
  38. package/lib/module/assets/icons/index.js +1 -1
  39. package/lib/module/assets/icons/index.js.map +1 -1
  40. package/lib/module/assets/icons/layer1.svg +15 -0
  41. package/lib/module/assets/icons/not_found.svg +135 -0
  42. package/lib/module/components/SkeletonLoanCard.js +2 -0
  43. package/lib/module/components/SkeletonLoanCard.js.map +1 -0
  44. package/lib/module/index.js +1 -1
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/module/navigation/index.js +1 -1
  47. package/lib/module/navigation/index.js.map +1 -1
  48. package/lib/module/navigation/navigationRef.js +2 -0
  49. package/lib/module/navigation/navigationRef.js.map +1 -0
  50. package/lib/module/navigation/primary-navigator.js +1 -1
  51. package/lib/module/navigation/primary-navigator.js.map +1 -1
  52. package/lib/module/screens/detail-loan/DetailLoanTima.js +1 -1
  53. package/lib/module/screens/detail-loan/DetailLoanTima.js.map +1 -1
  54. package/lib/module/screens/detail-loan/PaymentInfo.js +1 -1
  55. package/lib/module/screens/detail-loan/PaymentInfo.js.map +1 -1
  56. package/lib/module/screens/home/BoxGuidline.js +2 -0
  57. package/lib/module/screens/home/BoxGuidline.js.map +1 -0
  58. package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
  59. package/lib/module/screens/home/ItemMotoBikeLoan.js.map +1 -1
  60. package/lib/module/screens/home/index.js +1 -1
  61. package/lib/module/screens/home/index.js.map +1 -1
  62. package/lib/typescript/assets/icons/index.d.ts +4 -1
  63. package/lib/typescript/assets/icons/index.d.ts.map +1 -1
  64. package/lib/typescript/components/SkeletonLoanCard.d.ts +7 -0
  65. package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -0
  66. package/lib/typescript/index.d.ts +1 -0
  67. package/lib/typescript/index.d.ts.map +1 -1
  68. package/lib/typescript/navigation/index.d.ts +1 -0
  69. package/lib/typescript/navigation/index.d.ts.map +1 -1
  70. package/lib/typescript/navigation/navigationRef.d.ts +8 -0
  71. package/lib/typescript/navigation/navigationRef.d.ts.map +1 -0
  72. package/lib/typescript/navigation/primary-navigator.d.ts +15 -0
  73. package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
  74. package/lib/typescript/screens/home/BoxGuidline.d.ts +2 -0
  75. package/lib/typescript/screens/home/BoxGuidline.d.ts.map +1 -0
  76. package/lib/typescript/screens/home/ItemMotoBikeLoan.d.ts.map +1 -1
  77. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  78. package/package.json +1 -1
  79. package/src/assets/icons/gui.svg +102 -0
  80. package/src/assets/icons/index.tsx +6 -0
  81. package/src/assets/icons/layer1.svg +15 -0
  82. package/src/assets/icons/not_found.svg +135 -0
  83. package/src/components/SkeletonLoanCard.tsx +246 -0
  84. package/src/index.tsx +2 -1
  85. package/src/navigation/index.ts +1 -0
  86. package/src/navigation/navigationRef.ts +40 -0
  87. package/src/navigation/primary-navigator.tsx +30 -0
  88. package/src/screens/detail-loan/DetailLoanTima.tsx +1 -1
  89. package/src/screens/detail-loan/PaymentInfo.tsx +1 -0
  90. package/src/screens/home/BoxGuidline.tsx +58 -0
  91. package/src/screens/home/ItemMotoBikeLoan.tsx +6 -5
  92. package/src/screens/home/index.tsx +211 -205
@@ -0,0 +1,40 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * Navigation bridge for the Timacare SDK.
4
+ *
5
+ * The host app already owns its <NavigationContainer ref={...}>, so instead of
6
+ * creating a second ref the host registers its existing one here once (typically
7
+ * right after the container mounts). The SDK then uses it to drive navigation
8
+ * imperatively from outside React — e.g. deep-linking into a loan detail via
9
+ * `goDetail()`.
10
+ *
11
+ * Accepts either form of ref:
12
+ * - the object returned by `createNavigationContainerRef()` /
13
+ * `useNavigationContainerRef()` (methods live directly on it), or
14
+ * - a plain `useRef()` passed to <NavigationContainer ref={ref}> (methods live
15
+ * on `ref.current`).
16
+ */
17
+ let externalNavigationRef = null;
18
+
19
+ export const setNavigationRef = (ref) => {
20
+ externalNavigationRef = ref;
21
+ };
22
+
23
+ /**
24
+ * Resolves the registered ref down to the actual NavigationContainerRef,
25
+ * regardless of which ref form the host provided. Returns null when nothing is
26
+ * registered yet or the container isn't ready.
27
+ */
28
+ export const getNavigation = () => {
29
+ const ref = externalNavigationRef;
30
+ if (!ref) {
31
+ return null;
32
+ }
33
+
34
+ const nav = typeof ref.navigate === 'function' ? ref : ref.current;
35
+ if (!nav || (typeof nav.isReady === 'function' && !nav.isReady())) {
36
+ return null;
37
+ }
38
+
39
+ return nav;
40
+ };
@@ -8,6 +8,7 @@
8
8
  import React, { useEffect } from 'react';
9
9
 
10
10
  import { createNativeStackNavigator } from '@react-navigation/native-stack';
11
+ import { getNavigation } from './navigationRef';
11
12
  import { OTP } from '../screens/otp';
12
13
  import { NationalID } from '../screens/nationalID';
13
14
  import { Selfie } from '../screens/selfie';
@@ -317,3 +318,32 @@ export function PrimaryNavigator(props) {
317
318
 
318
319
  const exitRoutes = ['welcome'];
319
320
  export const canExit = (routeName: string) => exitRoutes.includes(routeName);
321
+
322
+ /**
323
+ * Imperatively navigate into a loan detail screen from outside React.
324
+ *
325
+ * Intended for the host app to deep-link the user straight into a loan detail
326
+ * (e.g. from a push notification or a list rendered outside the SDK). Requires
327
+ * the host to register its NavigationContainer ref once via `setNavigationRef()`.
328
+ *
329
+ * Accepts either a loan id or a partial loan object. The detail screen only
330
+ * needs `id` to fetch its data; `disbursementPartner` (when provided) selects
331
+ * the matching screen — 'CIMB' -> DetailLoan, otherwise -> DetailLoanTima.
332
+ */
333
+ export function goDetail(
334
+ loan: number | { id: number; disbursementPartner?: string }
335
+ ) {
336
+ const loanObj = typeof loan === 'number' ? { id: loan } : loan;
337
+ const navigation = getNavigation();
338
+
339
+ if (!loanObj?.id || !navigation) {
340
+ return;
341
+ }
342
+
343
+ const screen =
344
+ loanObj.disbursementPartner === 'CIMB'
345
+ ? ScreenNames.DetailLoan
346
+ : ScreenNames.DetailLoanTima;
347
+
348
+ navigation.navigate(screen, { loan: loanObj });
349
+ }
@@ -87,7 +87,7 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
87
87
  fontFamily: 'BeVietnamPro-SemiBold',
88
88
  }}
89
89
  >
90
- HD-1043102
90
+ HD-{props.route?.params?.loan?.id}
91
91
  </MText>
92
92
  </View>
93
93
  <View
@@ -607,6 +607,7 @@ const PaymentInfoContent = observer(function PaymentInfoContent(props: any) {
607
607
  await Api.getInstance().confirm_final_settlement({
608
608
  loanBriefId: props?.route.params?.loan?.id,
609
609
  });
610
+
610
611
  if (
611
612
  response.kind === 'ok' &&
612
613
  response.data?.meta?.errorCode === 200
@@ -0,0 +1,58 @@
1
+ //@ts-nocheck
2
+ import React from 'react';
3
+ import { StyleSheet, View } from 'react-native';
4
+ import LinearGradient from 'react-native-linear-gradient';
5
+ import { MText } from '../../components/MText';
6
+ import { GuiSvg, Layer1Svg } from '../../assets/icons';
7
+ export default function BoxGuidline() {
8
+ return (
9
+ <LinearGradient colors={['#FFF8F2', '#FFFFFF']} style={styles.container}>
10
+ <MText
11
+ style={{
12
+ fontFamily: 'BeVietnamPro-SemiBold',
13
+ fontWeight: '600',
14
+ }}
15
+ >
16
+ Chuẩn bị trước khi hoàn thiện đơn
17
+ </MText>
18
+ <View style={styles.row}>
19
+ <View style={{ flex: 1, flexDirection: 'column', gap: 6 }}>
20
+ <View style={styles.item}>
21
+ <Layer1Svg />
22
+ <MText style={{ fontSize: 12 }}>Giấy đăng ký xe rõ nét</MText>
23
+ </View>
24
+ <View style={styles.item}>
25
+ <Layer1Svg />
26
+ <MText style={{ fontSize: 12 }}>CCCD gắn chip bản gốc</MText>
27
+ </View>
28
+ <View style={styles.item}>
29
+ <Layer1Svg />
30
+ <MText style={{ fontSize: 12 }}>Không gian đủ ánh sáng</MText>
31
+ </View>
32
+ </View>
33
+ <View style={{ marginRight: 24 }}>
34
+ <GuiSvg />
35
+ </View>
36
+ </View>
37
+ </LinearGradient>
38
+ );
39
+ }
40
+
41
+ const styles = StyleSheet.create({
42
+ container: {
43
+ borderWidth: 1,
44
+ borderColor: '#E5E5EA',
45
+ borderRadius: 8,
46
+ padding: 8,
47
+ },
48
+ row: {
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ gap: 16,
52
+ },
53
+ item: {
54
+ flexDirection: 'row',
55
+ alignItems: 'center',
56
+ gap: 10,
57
+ },
58
+ });
@@ -489,7 +489,7 @@ export default function ItemMotoBikeLoan({
489
489
  <MText
490
490
  style={{ fontSize: 16, fontWeight: 'bold', textAlign: 'center' }}
491
491
  >
492
- Tiếp tục xử đơn vay của bạn
492
+ Xác nhận chia sẻ dữ liệu
493
493
  </MText>
494
494
  <View
495
495
  style={{
@@ -508,10 +508,11 @@ export default function ItemMotoBikeLoan({
508
508
  <MText
509
509
  style={{ color: '#828282', textAlign: 'center', marginTop: 16 }}
510
510
  >
511
- Tima sẽ chuyển thông tin đơn vay của bạn sang đối tác Công ty Cổ
512
- phần Kinh doanh F88 để hoàn thiện thủ tục giải ngân. Khi chọn “Đồng
513
- ý & Tiếp tục”, bạn xác nhận đồng ý cho việc thu thập, sử dụng và
514
- chia sẻ thông tin theo quy định về bảo vệ dữ liệu nhân.
511
+ Tima sẽ chuyển thông tin của bạn đến Công ty Cổ phần Kinh doanh F88
512
+ (F88) để xem xét phê duyệt khoản vay. Khi chọn "Đồng ý & Tiếp tục",
513
+ bạn đồng ý cho các bên liên quan thu thập, sử dụng, xử lý chia sẻ
514
+ dữ liệu nhân theo quy định của pháp luật. Sau khi chuyển giao dữ
515
+ liệu, Tima là bên kiểm soát và xử lý dữ liệu cá nhân.
515
516
  </MText>
516
517
  <View
517
518
  style={{