@tima2025/react-native-timalender 1.1.6 → 1.1.8

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 (97) hide show
  1. package/lib/commonjs/components/Features/Debt/debtSlice.js.flow +2 -2
  2. package/lib/commonjs/components/Features/Debt/debtSlice.js.map +1 -1
  3. package/lib/commonjs/components/Navigation/AppNavigator.js +1 -1
  4. package/lib/commonjs/components/Navigation/AppNavigator.js.flow +18 -0
  5. package/lib/commonjs/components/Navigation/AppNavigator.js.map +1 -1
  6. package/lib/commonjs/controllers/Debt.js +1 -1
  7. package/lib/commonjs/controllers/Debt.js.flow +12 -4
  8. package/lib/commonjs/controllers/Debt.js.map +1 -1
  9. package/lib/commonjs/screens/AdditionalInvestmentCapital/index.js +1 -1
  10. package/lib/commonjs/screens/AdditionalInvestmentCapital/index.js.flow +2 -0
  11. package/lib/commonjs/screens/AdditionalInvestmentCapital/index.js.map +1 -1
  12. package/lib/commonjs/screens/AvailableAmount/index.js +1 -1
  13. package/lib/commonjs/screens/AvailableAmount/index.js.flow +2 -0
  14. package/lib/commonjs/screens/AvailableAmount/index.js.map +1 -1
  15. package/lib/commonjs/screens/BuyDebt/Components/ListSuccess/ListSuccess.js +1 -1
  16. package/lib/commonjs/screens/BuyDebt/Components/ListSuccess/ListSuccess.js.flow +1 -0
  17. package/lib/commonjs/screens/BuyDebt/Components/ListSuccess/ListSuccess.js.map +1 -1
  18. package/lib/commonjs/screens/ContractDetail/index.js +1 -1
  19. package/lib/commonjs/screens/ContractDetail/index.js.flow +1 -0
  20. package/lib/commonjs/screens/ContractDetail/index.js.map +1 -1
  21. package/lib/commonjs/screens/DashBoardDetail/index.js +1 -1
  22. package/lib/commonjs/screens/DashBoardDetail/index.js.flow +2 -0
  23. package/lib/commonjs/screens/DashBoardDetail/index.js.map +1 -1
  24. package/lib/commonjs/screens/DetailBuyDue/index.js +1 -1
  25. package/lib/commonjs/screens/DetailBuyDue/index.js.flow +4 -15
  26. package/lib/commonjs/screens/DetailBuyDue/index.js.map +1 -1
  27. package/lib/commonjs/screens/InvestDetail/index.js +1 -1
  28. package/lib/commonjs/screens/InvestDetail/index.js.flow +4 -1
  29. package/lib/commonjs/screens/InvestDetail/index.js.map +1 -1
  30. package/lib/commonjs/screens/SellDebt/Tabs/Sold.js +1 -1
  31. package/lib/commonjs/screens/SellDebt/Tabs/Sold.js.flow +3 -2
  32. package/lib/commonjs/screens/SellDebt/Tabs/Sold.js.map +1 -1
  33. package/lib/commonjs/screens/Transfer/Tabs/Buy.js +1 -1
  34. package/lib/commonjs/screens/Transfer/Tabs/Buy.js.flow +8 -4
  35. package/lib/commonjs/screens/Transfer/Tabs/Buy.js.map +1 -1
  36. package/lib/commonjs/screens/Transfer/Tabs/Sell.js +1 -1
  37. package/lib/commonjs/screens/Transfer/Tabs/Sell.js.flow +12 -3
  38. package/lib/commonjs/screens/Transfer/Tabs/Sell.js.map +1 -1
  39. package/lib/commonjs/screens/Transfer/index.js +1 -1
  40. package/lib/commonjs/screens/Transfer/index.js.flow +19 -18
  41. package/lib/commonjs/screens/Transfer/index.js.map +1 -1
  42. package/lib/module/components/Features/Debt/debtSlice.js.map +1 -1
  43. package/lib/module/components/Navigation/AppNavigator.js +1 -1
  44. package/lib/module/components/Navigation/AppNavigator.js.map +1 -1
  45. package/lib/module/controllers/Debt.js +1 -1
  46. package/lib/module/controllers/Debt.js.map +1 -1
  47. package/lib/module/screens/AdditionalInvestmentCapital/index.js +1 -1
  48. package/lib/module/screens/AdditionalInvestmentCapital/index.js.map +1 -1
  49. package/lib/module/screens/AvailableAmount/index.js +1 -1
  50. package/lib/module/screens/AvailableAmount/index.js.map +1 -1
  51. package/lib/module/screens/BuyDebt/Components/ListSuccess/ListSuccess.js +1 -1
  52. package/lib/module/screens/BuyDebt/Components/ListSuccess/ListSuccess.js.map +1 -1
  53. package/lib/module/screens/ContractDetail/index.js +1 -1
  54. package/lib/module/screens/ContractDetail/index.js.map +1 -1
  55. package/lib/module/screens/DashBoardDetail/index.js +1 -1
  56. package/lib/module/screens/DashBoardDetail/index.js.map +1 -1
  57. package/lib/module/screens/DetailBuyDue/index.js +1 -1
  58. package/lib/module/screens/DetailBuyDue/index.js.map +1 -1
  59. package/lib/module/screens/InvestDetail/index.js +1 -1
  60. package/lib/module/screens/InvestDetail/index.js.map +1 -1
  61. package/lib/module/screens/SellDebt/Tabs/Sold.js +1 -1
  62. package/lib/module/screens/SellDebt/Tabs/Sold.js.map +1 -1
  63. package/lib/module/screens/Transfer/Tabs/Buy.js +1 -1
  64. package/lib/module/screens/Transfer/Tabs/Buy.js.map +1 -1
  65. package/lib/module/screens/Transfer/Tabs/Sell.js +1 -1
  66. package/lib/module/screens/Transfer/Tabs/Sell.js.map +1 -1
  67. package/lib/module/screens/Transfer/index.js +1 -1
  68. package/lib/module/screens/Transfer/index.js.map +1 -1
  69. package/lib/typescript/src/components/Navigation/AppNavigator.d.ts.map +1 -1
  70. package/lib/typescript/src/controllers/Debt.d.ts +2 -2
  71. package/lib/typescript/src/controllers/Debt.d.ts.map +1 -1
  72. package/lib/typescript/src/screens/AdditionalInvestmentCapital/index.d.ts.map +1 -1
  73. package/lib/typescript/src/screens/AvailableAmount/index.d.ts.map +1 -1
  74. package/lib/typescript/src/screens/BuyDebt/Components/ListSuccess/ListSuccess.d.ts.map +1 -1
  75. package/lib/typescript/src/screens/ContractDetail/index.d.ts.map +1 -1
  76. package/lib/typescript/src/screens/DashBoardDetail/index.d.ts.map +1 -1
  77. package/lib/typescript/src/screens/DetailBuyDue/index.d.ts.map +1 -1
  78. package/lib/typescript/src/screens/InvestDetail/index.d.ts.map +1 -1
  79. package/lib/typescript/src/screens/SellDebt/Tabs/Sold.d.ts.map +1 -1
  80. package/lib/typescript/src/screens/Transfer/Tabs/Buy.d.ts.map +1 -1
  81. package/lib/typescript/src/screens/Transfer/Tabs/Sell.d.ts.map +1 -1
  82. package/lib/typescript/src/screens/Transfer/index.d.ts.map +1 -1
  83. package/package.json +1 -1
  84. package/src/components/Features/Debt/debtSlice.ts +2 -2
  85. package/src/components/Navigation/AppNavigator.tsx +18 -0
  86. package/src/controllers/Debt.ts +12 -4
  87. package/src/screens/AdditionalInvestmentCapital/index.tsx +2 -0
  88. package/src/screens/AvailableAmount/index.tsx +2 -0
  89. package/src/screens/BuyDebt/Components/ListSuccess/ListSuccess.tsx +1 -0
  90. package/src/screens/ContractDetail/index.tsx +1 -0
  91. package/src/screens/DashBoardDetail/index.tsx +2 -0
  92. package/src/screens/DetailBuyDue/index.tsx +4 -15
  93. package/src/screens/InvestDetail/index.tsx +4 -1
  94. package/src/screens/SellDebt/Tabs/Sold.tsx +3 -2
  95. package/src/screens/Transfer/Tabs/Buy.tsx +8 -4
  96. package/src/screens/Transfer/Tabs/Sell.tsx +12 -3
  97. package/src/screens/Transfer/index.tsx +19 -18
@@ -281,6 +281,7 @@ const ListSuccess = () => {
281
281
  tintColor={Colors.ORANGE_H}
282
282
  />
283
283
  }
284
+ contentContainerStyle={{ paddingBottom: 200 }}
284
285
  data={data}
285
286
  stickyHeaderIndices={[0]}
286
287
  keyExtractor={(item, index) =>
@@ -244,6 +244,7 @@ export const ContractDetail = ({ route, navigation }: any) => {
244
244
  <FlatList
245
245
  data={listContracts?.detailData}
246
246
  keyExtractor={(item, index) => `${index}`}
247
+ contentContainerStyle={{ paddingBottom: 40 }}
247
248
  renderItem={_renderItem}
248
249
  ListEmptyComponent={() => <EmptyView text="Không có hợp đồng nào" />}
249
250
  />
@@ -167,6 +167,7 @@ export const DashBoardDetail = ({ navigation, route }: any) => {
167
167
  setOpenRecharge(true);
168
168
  }, 800);
169
169
  } else {
170
+ setOpenConfirmInvestment(false);
170
171
  // WToastShowError(resp?.payload?.meta?.errMessage, WToast.position.TOP);
171
172
  showMessage({
172
173
  message: 'Thông báo',
@@ -175,6 +176,7 @@ export const DashBoardDetail = ({ navigation, route }: any) => {
175
176
  icon: 'warning',
176
177
  position: 'top',
177
178
  backgroundColor: Colors.DANGER,
179
+ duration: 2000,
178
180
  });
179
181
  }
180
182
  };
@@ -54,27 +54,16 @@ export const DetailBuyDue = ({ navigation, route }: any) => {
54
54
  title="Hợp đồng"
55
55
  onPress={() => navigation.navigate('MyBank.Main')}
56
56
  />
57
- <View
58
- style={{
59
- width: '100%',
60
- height: '100%',
61
- }}
62
- >
57
+ <View style={{ flex: 1 }}>
63
58
  <Pdf
64
59
  showsVerticalScrollIndicator={false}
65
60
  source={{ uri: data?.url, cache: true }}
66
- style={{ width: '100%', height: '100%' }}
61
+ style={{ flex: 1 }}
67
62
  trustAllCerts={false}
68
63
  />
69
- <View
70
- style={{
71
- position: 'absolute',
72
- width: '100%',
73
- bottom: actuatedNormalize(100),
74
- }}
75
- >
64
+ <View style={{ padding: actuatedNormalize(16) }}>
76
65
  <Button
77
- text={'Ký hợp đồng'}
66
+ text="Ký hợp đồng"
78
67
  onPress={onSubmit}
79
68
  buttonStyle={{
80
69
  marginBottom: actuatedNormalize(32),
@@ -233,6 +233,8 @@ export const InvestDetail = ({ route, navigation }: any) => {
233
233
  setOpenRecharge(true);
234
234
  }, 800);
235
235
  } else {
236
+ setOpenConfirmInvestment(false);
237
+
236
238
  // WToastShowError(resp?.payload?.meta?.errMessage, WToast.position.TOP);
237
239
  showMessage({
238
240
  message: 'Thông báo',
@@ -241,6 +243,7 @@ export const InvestDetail = ({ route, navigation }: any) => {
241
243
  icon: 'warning',
242
244
  position: 'top',
243
245
  backgroundColor: Colors.DANGER,
246
+ duration: 2000,
244
247
  });
245
248
  }
246
249
  };
@@ -456,7 +459,7 @@ export const InvestDetail = ({ route, navigation }: any) => {
456
459
  color: '#606060',
457
460
  }}
458
461
  >
459
- {`Lãi đã nhận`}
462
+ {'Lãi đã nhận'}
460
463
  </Text>
461
464
  <View
462
465
  style={{
@@ -277,7 +277,7 @@ const Sold = () => {
277
277
  };
278
278
 
279
279
  return (
280
- <View>
280
+ <View style={{ flex: 1 }}>
281
281
  <FlexRow
282
282
  style={{
283
283
  padding: 12,
@@ -340,7 +340,7 @@ const Sold = () => {
340
340
  </View>
341
341
  </FlexRow>
342
342
 
343
- <View style={{ height: '70%' }}>
343
+ <View style={{ flex: 1 }}>
344
344
  <FlatList
345
345
  refreshControl={
346
346
  <RefreshControl
@@ -350,6 +350,7 @@ const Sold = () => {
350
350
  />
351
351
  }
352
352
  data={data}
353
+ contentContainerStyle={{ paddingBottom: 40 }}
353
354
  keyExtractor={(item, index) => index.toString()}
354
355
  renderItem={_renderItemLenderSell}
355
356
  stickyHeaderIndices={[0]}
@@ -25,15 +25,19 @@ import {
25
25
  import Countdown from '../../../hooks/Countdown/useCountdown';
26
26
 
27
27
  const Buy = (props) => {
28
- const { dataDebts } = props;
28
+ const { dataDebts, value } = props;
29
29
  const navigation = useNavigation();
30
30
  const dispatch = useAppDispatch();
31
31
  const [refreshing, setRefreshing] = useState(false);
32
32
  const [debts, setDebts] = useState(dataDebts);
33
33
 
34
34
  useEffect(() => {
35
- getListBuying(-111);
36
- }, []);
35
+ getListBuying(value);
36
+ }, [value]);
37
+
38
+ useEffect(() => {
39
+ setDebts(dataDebts);
40
+ }, [dataDebts]);
37
41
 
38
42
  const wait = (timeout: number | undefined) => {
39
43
  return new Promise((resolve) => setTimeout(resolve, timeout));
@@ -59,7 +63,7 @@ const Buy = (props) => {
59
63
  } else {
60
64
  setDebts([]);
61
65
  }
62
- console.log('respresp', JSON.stringify(resp));
66
+ console.log('respresp BUY', JSON.stringify(resp));
63
67
  } catch (error) {
64
68
  console.log('catching error getListBuy: ', error);
65
69
  }
@@ -3,7 +3,7 @@
3
3
  //@ts-nocheck
4
4
  import { useNavigation } from '@react-navigation/native';
5
5
  import moment from 'moment';
6
- import React, { useState } from 'react';
6
+ import React, { useEffect, useState } from 'react';
7
7
  import { FlatList, RefreshControl, TouchableOpacity, View } from 'react-native';
8
8
  import Feather from 'react-native-vector-icons/Feather';
9
9
  import Colors from '../../../common/Colors';
@@ -25,11 +25,20 @@ import {
25
25
  import Countdown from '../../../hooks/Countdown/useCountdown';
26
26
 
27
27
  const Sell = (props) => {
28
- const { dataDebts } = props;
28
+ const { dataDebts, value } = props;
29
29
  const navigation = useNavigation();
30
30
  const dispatch = useAppDispatch();
31
+ const [debts, setDebts] = useState(dataDebts);
31
32
  const [refreshing, setRefreshing] = useState(false);
32
33
 
34
+ useEffect(() => {
35
+ getListSelling(value);
36
+ }, [value]);
37
+
38
+ useEffect(() => {
39
+ setDebts(dataDebts);
40
+ }, [dataDebts]);
41
+
33
42
  const wait = (timeout: number | undefined) => {
34
43
  return new Promise((resolve) => setTimeout(resolve, timeout));
35
44
  };
@@ -251,7 +260,7 @@ const Sell = (props) => {
251
260
  }}
252
261
  >
253
262
  <FlatList
254
- data={dataDebts}
263
+ data={debts}
255
264
  keyExtractor={(i, index) => index.toString()}
256
265
  renderItem={_renderItems}
257
266
  showsVerticalScrollIndicator={false}
@@ -1,5 +1,5 @@
1
- //@ts-nocheck
2
1
  /* eslint-disable react-native/no-inline-styles */
2
+ //@ts-nocheck
3
3
  import React, { useEffect, useRef, useState } from 'react';
4
4
  import { TouchableOpacity, View } from 'react-native';
5
5
  import { showMessage } from 'react-native-flash-message';
@@ -38,8 +38,9 @@ const Transfer = ({ navigation, route }: any) => {
38
38
  const [showPopover, setShowPopover] = useState(false);
39
39
  const [openDropdown, setOpenDropdown] = useState(false);
40
40
  const [shopName, setShopName] = useState('');
41
- const [value, setValue] = useState(-111);
42
- const [dataDebts, setDataDebts] = useState([]);
41
+ const [value, setValue] = useState<number[]>([-111]);
42
+ const [dataBuy, setDataBuy] = useState([]);
43
+ const [dataSell, setDataSell] = useState([]);
43
44
  const [refreshing, setRefreshing] = useState(false);
44
45
  const userData = useSelector(userInfor);
45
46
 
@@ -59,26 +60,26 @@ const Transfer = ({ navigation, route }: any) => {
59
60
  } else {
60
61
  getListBuying(value);
61
62
  }
62
- }, [currentTab, userData?.accessToken]);
63
+ }, [currentTab, userData?.accessToken, value]);
63
64
 
64
- const getListSelling = async (status: number) => {
65
+ const getListSelling = async (status: number | number[]) => {
65
66
  const resp: any = await dispatch(getSellingDebtsTrading(status));
66
67
  if (resp?.payload?.data?.length) {
67
68
  const _data = resp?.payload?.data || [];
68
- setDataDebts(_data);
69
+ setDataSell(_data);
69
70
  } else {
70
- setDataDebts([]);
71
+ setDataSell([]);
71
72
  }
72
73
  console.log('resp selling----', resp);
73
74
  };
74
75
 
75
- const getListBuying = async (status: number) => {
76
+ const getListBuying = async (status: number | number[]) => {
76
77
  const resp: any = await dispatch(getBuyingDebtsTrading(status));
77
78
  if (resp?.payload?.data?.length) {
78
79
  const _data = resp?.payload?.data || [];
79
- setDataDebts(_data);
80
+ setDataBuy(_data);
80
81
  } else {
81
- setDataDebts([]);
82
+ setDataBuy([]);
82
83
  }
83
84
  console.log('respresp', JSON.stringify(resp));
84
85
  };
@@ -292,20 +293,20 @@ const Transfer = ({ navigation, route }: any) => {
292
293
  </FlexRow>
293
294
 
294
295
  {currentTab === 0 ? (
295
- <Buy dataDebts={dataDebts} />
296
+ <Buy dataDebts={dataBuy} />
296
297
  ) : (
297
- <Sell dataDebts={dataDebts} />
298
+ <Sell dataDebts={dataSell} />
298
299
  )}
299
300
  </View>
300
301
 
301
302
  <PopoverSortDebt
302
303
  tab={currentTab}
303
- onPress={(value) => {
304
- if (currentTab === 0) {
305
- getListBuying(value);
306
- } else {
307
- getListSelling(value);
308
- }
304
+ onPress={(val: string) => {
305
+ console.log('value press: ', val);
306
+
307
+ const arr = val.split(',').map((v) => Number(v.trim()));
308
+
309
+ setValue(arr);
309
310
  setShowPopover(false);
310
311
  }}
311
312
  isVisible={showPopover}