react-native-timacare 3.3.43 → 3.3.45

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 (80) 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 +66 -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 +38 -0
  21. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  22. package/lib/commonjs/screens/home/BoxGuidline.js +2 -0
  23. package/lib/commonjs/screens/home/BoxGuidline.js.flow +58 -0
  24. package/lib/commonjs/screens/home/BoxGuidline.js.map +1 -0
  25. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
  26. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +6 -5
  27. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.map +1 -1
  28. package/lib/commonjs/screens/home/index.js +1 -1
  29. package/lib/commonjs/screens/home/index.js.flow +211 -204
  30. package/lib/commonjs/screens/home/index.js.map +1 -1
  31. package/lib/module/assets/icons/gui.svg +102 -0
  32. package/lib/module/assets/icons/index.js +1 -1
  33. package/lib/module/assets/icons/index.js.map +1 -1
  34. package/lib/module/assets/icons/layer1.svg +15 -0
  35. package/lib/module/assets/icons/not_found.svg +135 -0
  36. package/lib/module/components/SkeletonLoanCard.js +2 -0
  37. package/lib/module/components/SkeletonLoanCard.js.map +1 -0
  38. package/lib/module/index.js +1 -1
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/navigation/index.js +1 -1
  41. package/lib/module/navigation/index.js.map +1 -1
  42. package/lib/module/navigation/navigationRef.js +2 -0
  43. package/lib/module/navigation/navigationRef.js.map +1 -0
  44. package/lib/module/navigation/primary-navigator.js +1 -1
  45. package/lib/module/navigation/primary-navigator.js.map +1 -1
  46. package/lib/module/screens/home/BoxGuidline.js +2 -0
  47. package/lib/module/screens/home/BoxGuidline.js.map +1 -0
  48. package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
  49. package/lib/module/screens/home/ItemMotoBikeLoan.js.map +1 -1
  50. package/lib/module/screens/home/index.js +1 -1
  51. package/lib/module/screens/home/index.js.map +1 -1
  52. package/lib/typescript/assets/icons/index.d.ts +4 -1
  53. package/lib/typescript/assets/icons/index.d.ts.map +1 -1
  54. package/lib/typescript/components/SkeletonLoanCard.d.ts +7 -0
  55. package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -0
  56. package/lib/typescript/index.d.ts +1 -0
  57. package/lib/typescript/index.d.ts.map +1 -1
  58. package/lib/typescript/navigation/index.d.ts +1 -0
  59. package/lib/typescript/navigation/index.d.ts.map +1 -1
  60. package/lib/typescript/navigation/navigationRef.d.ts +14 -0
  61. package/lib/typescript/navigation/navigationRef.d.ts.map +1 -0
  62. package/lib/typescript/navigation/primary-navigator.d.ts +15 -0
  63. package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
  64. package/lib/typescript/screens/home/BoxGuidline.d.ts +2 -0
  65. package/lib/typescript/screens/home/BoxGuidline.d.ts.map +1 -0
  66. package/lib/typescript/screens/home/ItemMotoBikeLoan.d.ts.map +1 -1
  67. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/src/assets/icons/gui.svg +102 -0
  70. package/src/assets/icons/index.tsx +6 -0
  71. package/src/assets/icons/layer1.svg +15 -0
  72. package/src/assets/icons/not_found.svg +135 -0
  73. package/src/components/SkeletonLoanCard.tsx +246 -0
  74. package/src/index.tsx +2 -1
  75. package/src/navigation/index.ts +1 -0
  76. package/src/navigation/navigationRef.ts +66 -0
  77. package/src/navigation/primary-navigator.tsx +38 -0
  78. package/src/screens/home/BoxGuidline.tsx +58 -0
  79. package/src/screens/home/ItemMotoBikeLoan.tsx +6 -5
  80. package/src/screens/home/index.tsx +211 -204
@@ -0,0 +1,66 @@
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
+ * Navigation object scoped to the SDK's own navigator (PrimaryNavigator).
25
+ *
26
+ * Why this exists: SDK screens (DetailLoan, DetailLoanTima, ...) are registered
27
+ * ONLY inside PrimaryNavigator. React Navigation's `navigate()` bubbles UP to
28
+ * parent navigators, never DOWN into descendants — so the host's root container
29
+ * ref cannot reach an SDK screen when the host mounts the SDK nested below its
30
+ * own root. Registering the SDK navigator's own navigation object (captured from
31
+ * inside its tree) lets `getNavigation()` dispatch directly on the navigator that
32
+ * actually owns those screens.
33
+ */
34
+ let sdkNavigation = null;
35
+
36
+ export const setSdkNavigation = (nav) => {
37
+ sdkNavigation = nav;
38
+ };
39
+
40
+ /**
41
+ * Resolves the navigation object to drive SDK navigation imperatively.
42
+ *
43
+ * Prefers the SDK navigator's own navigation object (so SDK-internal screens
44
+ * always resolve, even when the SDK is nested in the host's navigation tree).
45
+ * Falls back to the host-registered NavigationContainer ref — which only reaches
46
+ * SDK screens when the host mounts PrimaryNavigator as its root navigator.
47
+ *
48
+ * Returns null when nothing is registered yet or the container isn't ready.
49
+ */
50
+ export const getNavigation = () => {
51
+ if (sdkNavigation && typeof sdkNavigation.navigate === 'function') {
52
+ return sdkNavigation;
53
+ }
54
+
55
+ const ref = externalNavigationRef;
56
+ if (!ref) {
57
+ return null;
58
+ }
59
+
60
+ const nav = typeof ref.navigate === 'function' ? ref : ref.current;
61
+ if (!nav || (typeof nav.isReady === 'function' && !nav.isReady())) {
62
+ return null;
63
+ }
64
+
65
+ return nav;
66
+ };
@@ -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, setSdkNavigation } from './navigationRef';
11
12
  import { OTP } from '../screens/otp';
12
13
  import { NationalID } from '../screens/nationalID';
13
14
  import { Selfie } from '../screens/selfie';
@@ -162,6 +163,14 @@ export function PrimaryNavigator(props) {
162
163
  screenOptions={{
163
164
  headerShown: false,
164
165
  }}
166
+ // Capture this navigator's own navigation object so goDetail() (and any
167
+ // other imperative SDK navigation) can reach SDK screens even when the host
168
+ // mounts this navigator nested inside its tree. The screen `navigation`
169
+ // prop is scoped to THIS stack, so navigate() resolves SDK screens directly.
170
+ screenListeners={({ navigation }) => {
171
+ setSdkNavigation(navigation);
172
+ return {};
173
+ }}
165
174
  >
166
175
  <Stack.Screen name={ScreenNames.Main} component={Home} />
167
176
  <Stack.Screen name={ScreenNames.NationalID} component={NationalID} />
@@ -317,3 +326,32 @@ export function PrimaryNavigator(props) {
317
326
 
318
327
  const exitRoutes = ['welcome'];
319
328
  export const canExit = (routeName: string) => exitRoutes.includes(routeName);
329
+
330
+ /**
331
+ * Imperatively navigate into a loan detail screen from outside React.
332
+ *
333
+ * Intended for the host app to deep-link the user straight into a loan detail
334
+ * (e.g. from a push notification or a list rendered outside the SDK). Requires
335
+ * the host to register its NavigationContainer ref once via `setNavigationRef()`.
336
+ *
337
+ * Accepts either a loan id or a partial loan object. The detail screen only
338
+ * needs `id` to fetch its data; `disbursementPartner` (when provided) selects
339
+ * the matching screen — 'CIMB' -> DetailLoan, otherwise -> DetailLoanTima.
340
+ */
341
+ export function goDetail(
342
+ loan: number | { id: number; disbursementPartner?: string }
343
+ ) {
344
+ const loanObj = typeof loan === 'number' ? { id: loan } : loan;
345
+ const navigation = getNavigation();
346
+
347
+ if (!loanObj?.id || !navigation) {
348
+ return;
349
+ }
350
+
351
+ const screen =
352
+ loanObj.disbursementPartner === 'CIMB'
353
+ ? ScreenNames.DetailLoan
354
+ : ScreenNames.DetailLoanTima;
355
+
356
+ navigation.navigate(screen, { loan: loanObj });
357
+ }
@@ -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={{