@finspringinnovations/fixeddepositsdk 1.0.0

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 (311) hide show
  1. package/README.md +128 -0
  2. package/lib/api/applicationApi.d.ts +1 -0
  3. package/lib/api/applicationApi.js +11 -0
  4. package/lib/api/bankApi.d.ts +352 -0
  5. package/lib/api/bankApi.js +54 -0
  6. package/lib/api/baseApi.d.ts +6 -0
  7. package/lib/api/baseApi.js +406 -0
  8. package/lib/api/customerApi.d.ts +855 -0
  9. package/lib/api/customerApi.js +241 -0
  10. package/lib/api/fdApi.d.ts +979 -0
  11. package/lib/api/fdApi.js +112 -0
  12. package/lib/api/fdCalculatorApi.d.ts +179 -0
  13. package/lib/api/fdCalculatorApi.js +36 -0
  14. package/lib/api/index.d.ts +14 -0
  15. package/lib/api/index.js +45 -0
  16. package/lib/api/interestRateApi.d.ts +585 -0
  17. package/lib/api/interestRateApi.js +101 -0
  18. package/lib/api/kycApi.d.ts +486 -0
  19. package/lib/api/kycApi.js +71 -0
  20. package/lib/api/masterDataApi.d.ts +158 -0
  21. package/lib/api/masterDataApi.js +35 -0
  22. package/lib/api/nomineeApi.d.ts +325 -0
  23. package/lib/api/nomineeApi.js +46 -0
  24. package/lib/api/onboardingApi.d.ts +192 -0
  25. package/lib/api/onboardingApi.js +41 -0
  26. package/lib/api/panApi.d.ts +0 -0
  27. package/lib/api/panApi.js +23 -0
  28. package/lib/api/paymentApi.d.ts +325 -0
  29. package/lib/api/paymentApi.js +46 -0
  30. package/lib/api/workflowApi.d.ts +654 -0
  31. package/lib/api/workflowApi.js +90 -0
  32. package/lib/assets/images/images.d.ts +6 -0
  33. package/lib/assets/images/images.js +12 -0
  34. package/lib/components/AadhaarInput.d.ts +13 -0
  35. package/lib/components/AadhaarInput.js +47 -0
  36. package/lib/components/ActionButton.d.ts +12 -0
  37. package/lib/components/ActionButton.js +87 -0
  38. package/lib/components/ActiveFDCard.d.ts +18 -0
  39. package/lib/components/ActiveFDCard.js +116 -0
  40. package/lib/components/AmountInput.d.ts +20 -0
  41. package/lib/components/AmountInput.js +142 -0
  42. package/lib/components/CheckboxOption.d.ts +11 -0
  43. package/lib/components/CheckboxOption.js +41 -0
  44. package/lib/components/CompanyHeader.d.ts +7 -0
  45. package/lib/components/CompanyHeader.js +59 -0
  46. package/lib/components/DropdownSelector.d.ts +9 -0
  47. package/lib/components/DropdownSelector.js +49 -0
  48. package/lib/components/EmptyState.d.ts +17 -0
  49. package/lib/components/EmptyState.js +44 -0
  50. package/lib/components/ErrorDisplay.d.ts +17 -0
  51. package/lib/components/ErrorDisplay.js +69 -0
  52. package/lib/components/FAQItem.d.ts +9 -0
  53. package/lib/components/FAQItem.js +52 -0
  54. package/lib/components/FDCard.d.ts +23 -0
  55. package/lib/components/FDCard.js +116 -0
  56. package/lib/components/FormDropdown.d.ts +18 -0
  57. package/lib/components/FormDropdown.js +155 -0
  58. package/lib/components/FormSection.d.ts +14 -0
  59. package/lib/components/FormSection.js +38 -0
  60. package/lib/components/Header.d.ts +14 -0
  61. package/lib/components/Header.js +52 -0
  62. package/lib/components/IFSCSearchResultCard.d.ts +13 -0
  63. package/lib/components/IFSCSearchResultCard.js +70 -0
  64. package/lib/components/InfoBox.d.ts +8 -0
  65. package/lib/components/InfoBox.js +39 -0
  66. package/lib/components/InterestRateCard.d.ts +8 -0
  67. package/lib/components/InterestRateCard.js +46 -0
  68. package/lib/components/LoadingIndicator.d.ts +12 -0
  69. package/lib/components/LoadingIndicator.js +30 -0
  70. package/lib/components/OTPInput.d.ts +17 -0
  71. package/lib/components/OTPInput.js +144 -0
  72. package/lib/components/PaymentDetailsCard.d.ts +20 -0
  73. package/lib/components/PaymentDetailsCard.js +68 -0
  74. package/lib/components/PendingFDBottomSheet.d.ts +19 -0
  75. package/lib/components/PendingFDBottomSheet.js +122 -0
  76. package/lib/components/SafeAreaWrapper.d.ts +13 -0
  77. package/lib/components/SafeAreaWrapper.js +41 -0
  78. package/lib/components/ScreenHeader.d.ts +11 -0
  79. package/lib/components/ScreenHeader.js +46 -0
  80. package/lib/components/StatusDisplay.d.ts +15 -0
  81. package/lib/components/StatusDisplay.js +88 -0
  82. package/lib/components/TextFieldWithLabel.d.ts +46 -0
  83. package/lib/components/TextFieldWithLabel.js +326 -0
  84. package/lib/components/TrustBox.d.ts +8 -0
  85. package/lib/components/TrustBox.js +46 -0
  86. package/lib/components/ValidationErrorAlert.d.ts +23 -0
  87. package/lib/components/ValidationErrorAlert.js +39 -0
  88. package/lib/components/ValidationMessage.d.ts +9 -0
  89. package/lib/components/ValidationMessage.js +98 -0
  90. package/lib/components/index.d.ts +35 -0
  91. package/lib/components/index.js +64 -0
  92. package/lib/config/apiConfig.d.ts +34 -0
  93. package/lib/config/apiConfig.js +158 -0
  94. package/lib/config/appDataConfig.d.ts +159 -0
  95. package/lib/config/appDataConfig.js +310 -0
  96. package/lib/config/encryptionConfig.d.ts +21 -0
  97. package/lib/config/encryptionConfig.js +61 -0
  98. package/lib/config/workflowConstants.d.ts +62 -0
  99. package/lib/config/workflowConstants.js +63 -0
  100. package/lib/constants/strings/bank.d.ts +72 -0
  101. package/lib/constants/strings/bank.js +86 -0
  102. package/lib/constants/strings/base64Images.d.ts +26 -0
  103. package/lib/constants/strings/base64Images.js +29 -0
  104. package/lib/constants/strings/common.d.ts +53 -0
  105. package/lib/constants/strings/common.js +62 -0
  106. package/lib/constants/strings/employee.d.ts +61 -0
  107. package/lib/constants/strings/employee.js +77 -0
  108. package/lib/constants/strings/faq.d.ts +14 -0
  109. package/lib/constants/strings/faq.js +20 -0
  110. package/lib/constants/strings/fd.d.ts +122 -0
  111. package/lib/constants/strings/fd.js +151 -0
  112. package/lib/constants/strings/home.d.ts +49 -0
  113. package/lib/constants/strings/home.js +62 -0
  114. package/lib/constants/strings/index.d.ts +16 -0
  115. package/lib/constants/strings/index.js +44 -0
  116. package/lib/constants/strings/kyc.d.ts +80 -0
  117. package/lib/constants/strings/kyc.js +94 -0
  118. package/lib/constants/strings/nominee.d.ts +64 -0
  119. package/lib/constants/strings/nominee.js +81 -0
  120. package/lib/hooks/useAuth.d.ts +25 -0
  121. package/lib/hooks/useAuth.js +39 -0
  122. package/lib/hooks/useFDData.d.ts +11 -0
  123. package/lib/hooks/useFDData.js +40 -0
  124. package/lib/index.d.ts +48 -0
  125. package/lib/index.js +161 -0
  126. package/lib/navigation/RootNavigator.d.ts +9 -0
  127. package/lib/navigation/RootNavigator.js +459 -0
  128. package/lib/navigation/SimpleNavigator.d.ts +11 -0
  129. package/lib/navigation/SimpleNavigator.js +114 -0
  130. package/lib/navigation/helpers.d.ts +11 -0
  131. package/lib/navigation/helpers.js +83 -0
  132. package/lib/navigation/index.d.ts +17 -0
  133. package/lib/navigation/index.js +42 -0
  134. package/lib/navigation/types.d.ts +139 -0
  135. package/lib/navigation/types.js +2 -0
  136. package/lib/navigation/workflowNavigator.d.ts +22 -0
  137. package/lib/navigation/workflowNavigator.js +104 -0
  138. package/lib/providers/ApiProvider.d.ts +7 -0
  139. package/lib/providers/ApiProvider.js +16 -0
  140. package/lib/providers/MasterDataProvider.d.ts +10 -0
  141. package/lib/providers/MasterDataProvider.js +54 -0
  142. package/lib/screens/AadhaarVerification.d.ts +7 -0
  143. package/lib/screens/AadhaarVerification.js +627 -0
  144. package/lib/screens/AddBankAccount.d.ts +22 -0
  145. package/lib/screens/AddBankAccount.js +381 -0
  146. package/lib/screens/BankDetail.d.ts +16 -0
  147. package/lib/screens/BankDetail.js +596 -0
  148. package/lib/screens/Employee.d.ts +18 -0
  149. package/lib/screens/Employee.js +594 -0
  150. package/lib/screens/FDCalculator.d.ts +18 -0
  151. package/lib/screens/FDCalculator.js +767 -0
  152. package/lib/screens/FDList.d.ts +28 -0
  153. package/lib/screens/FDList.js +1853 -0
  154. package/lib/screens/FindIFSC.d.ts +16 -0
  155. package/lib/screens/FindIFSC.js +248 -0
  156. package/lib/screens/NomineeDetail.d.ts +17 -0
  157. package/lib/screens/NomineeDetail.js +592 -0
  158. package/lib/screens/PayNow.d.ts +14 -0
  159. package/lib/screens/PayNow.js +230 -0
  160. package/lib/screens/Payment.d.ts +11 -0
  161. package/lib/screens/Payment.js +191 -0
  162. package/lib/screens/PaymentStatus.d.ts +16 -0
  163. package/lib/screens/PaymentStatus.js +431 -0
  164. package/lib/screens/ReviewKYC.d.ts +23 -0
  165. package/lib/screens/ReviewKYC.js +727 -0
  166. package/lib/state/paymentSession.d.ts +8 -0
  167. package/lib/state/paymentSession.js +13 -0
  168. package/lib/store/fdListSelectedSlice.d.ts +21 -0
  169. package/lib/store/fdListSelectedSlice.js +26 -0
  170. package/lib/store/hooks.d.ts +8 -0
  171. package/lib/store/hooks.js +8 -0
  172. package/lib/store/index.d.ts +3 -0
  173. package/lib/store/index.js +8 -0
  174. package/lib/store/onboardingSlice.d.ts +12 -0
  175. package/lib/store/onboardingSlice.js +32 -0
  176. package/lib/store/store.d.ts +13 -0
  177. package/lib/store/store.js +27 -0
  178. package/lib/theme/ThemeContext.d.ts +210 -0
  179. package/lib/theme/ThemeContext.js +92 -0
  180. package/lib/theme/colors.d.ts +80 -0
  181. package/lib/theme/colors.js +85 -0
  182. package/lib/theme/index.d.ts +35 -0
  183. package/lib/theme/index.js +78 -0
  184. package/lib/theme/shadows.d.ts +53 -0
  185. package/lib/theme/shadows.js +58 -0
  186. package/lib/theme/typography.d.ts +134 -0
  187. package/lib/theme/typography.js +143 -0
  188. package/lib/types/dataTypes.d.ts +34 -0
  189. package/lib/types/dataTypes.js +2 -0
  190. package/lib/types/workflowTypes.d.ts +2 -0
  191. package/lib/types/workflowTypes.js +2 -0
  192. package/lib/utils/apiLogger.d.ts +48 -0
  193. package/lib/utils/apiLogger.js +105 -0
  194. package/lib/utils/encryption.d.ts +28 -0
  195. package/lib/utils/encryption.js +113 -0
  196. package/lib/utils/getFDData.d.ts +48 -0
  197. package/lib/utils/getFDData.js +145 -0
  198. package/lib/utils/globalData.d.ts +2 -0
  199. package/lib/utils/globalData.js +10 -0
  200. package/package.json +51 -0
  201. package/src/api/applicationApi.ts +12 -0
  202. package/src/api/bankApi.ts +42 -0
  203. package/src/api/baseApi.ts +463 -0
  204. package/src/api/customerApi.ts +324 -0
  205. package/src/api/fdApi.ts +150 -0
  206. package/src/api/fdCalculatorApi.ts +41 -0
  207. package/src/api/index.ts +29 -0
  208. package/src/api/interestRateApi.ts +143 -0
  209. package/src/api/kycApi.ts +63 -0
  210. package/src/api/masterDataApi.ts +37 -0
  211. package/src/api/nomineeApi.ts +34 -0
  212. package/src/api/onboardingApi.ts +64 -0
  213. package/src/api/panApi.ts +25 -0
  214. package/src/api/paymentApi.ts +34 -0
  215. package/src/api/workflowApi.ts +94 -0
  216. package/src/assets/images/Mahindra.png +0 -0
  217. package/src/assets/images/arrow-filled.png +0 -0
  218. package/src/assets/images/arrow-left.png +0 -0
  219. package/src/assets/images/backicon.png +0 -0
  220. package/src/assets/images/calendar.png +0 -0
  221. package/src/assets/images/chevron-down.png +0 -0
  222. package/src/assets/images/chevron-down@2x.png +0 -0
  223. package/src/assets/images/chevron-down@3x.png +0 -0
  224. package/src/assets/images/images.js +10 -0
  225. package/src/assets/images/shriram_logo.png +0 -0
  226. package/src/components/AadhaarInput.tsx +91 -0
  227. package/src/components/ActionButton.tsx +129 -0
  228. package/src/components/ActiveFDCard.tsx +188 -0
  229. package/src/components/AmountInput.tsx +217 -0
  230. package/src/components/CheckboxOption.tsx +93 -0
  231. package/src/components/CompanyHeader.tsx +80 -0
  232. package/src/components/DropdownSelector.tsx +77 -0
  233. package/src/components/EmptyState.tsx +109 -0
  234. package/src/components/ErrorDisplay.tsx +135 -0
  235. package/src/components/FAQItem.tsx +90 -0
  236. package/src/components/FDCard.tsx +186 -0
  237. package/src/components/FormDropdown.tsx +214 -0
  238. package/src/components/FormSection.tsx +86 -0
  239. package/src/components/Header.tsx +110 -0
  240. package/src/components/IFSCSearchResultCard.tsx +139 -0
  241. package/src/components/InfoBox.tsx +55 -0
  242. package/src/components/InterestRateCard.tsx +77 -0
  243. package/src/components/LoadingIndicator.tsx +63 -0
  244. package/src/components/OTPInput.tsx +213 -0
  245. package/src/components/PaymentDetailsCard.tsx +120 -0
  246. package/src/components/PendingFDBottomSheet.tsx +237 -0
  247. package/src/components/README.md +210 -0
  248. package/src/components/SafeAreaWrapper.tsx +68 -0
  249. package/src/components/ScreenHeader.tsx +83 -0
  250. package/src/components/StatusDisplay.tsx +139 -0
  251. package/src/components/TextFieldWithLabel.tsx +502 -0
  252. package/src/components/TrustBox.tsx +63 -0
  253. package/src/components/ValidationErrorAlert.tsx +57 -0
  254. package/src/components/ValidationMessage.tsx +134 -0
  255. package/src/components/index.tsx +47 -0
  256. package/src/config/apiConfig.ts +217 -0
  257. package/src/config/appDataConfig.ts +358 -0
  258. package/src/config/encryptionConfig.ts +65 -0
  259. package/src/config/workflowConstants.ts +70 -0
  260. package/src/constants/strings/README.md +146 -0
  261. package/src/constants/strings/bank.ts +92 -0
  262. package/src/constants/strings/base64Images.ts +31 -0
  263. package/src/constants/strings/common.ts +63 -0
  264. package/src/constants/strings/employee.ts +85 -0
  265. package/src/constants/strings/faq.ts +23 -0
  266. package/src/constants/strings/fd.ts +172 -0
  267. package/src/constants/strings/home.ts +67 -0
  268. package/src/constants/strings/index.ts +21 -0
  269. package/src/constants/strings/kyc.ts +100 -0
  270. package/src/constants/strings/nominee.ts +90 -0
  271. package/src/hooks/useAuth.ts +42 -0
  272. package/src/hooks/useFDData.ts +48 -0
  273. package/src/index.tsx +139 -0
  274. package/src/navigation/RootNavigator.tsx +687 -0
  275. package/src/navigation/SimpleNavigator.tsx +123 -0
  276. package/src/navigation/helpers.ts +85 -0
  277. package/src/navigation/index.tsx +84 -0
  278. package/src/navigation/types.ts +146 -0
  279. package/src/navigation/workflowNavigator.ts +131 -0
  280. package/src/providers/ApiProvider.tsx +23 -0
  281. package/src/providers/MasterDataProvider.tsx +30 -0
  282. package/src/screens/AadhaarVerification.tsx +809 -0
  283. package/src/screens/AddBankAccount.tsx +541 -0
  284. package/src/screens/BankDetail.tsx +826 -0
  285. package/src/screens/Employee.tsx +822 -0
  286. package/src/screens/FDCalculator.tsx +1002 -0
  287. package/src/screens/FDList.tsx +2199 -0
  288. package/src/screens/FindIFSC.tsx +332 -0
  289. package/src/screens/NomineeDetail.tsx +800 -0
  290. package/src/screens/PayNow.tsx +282 -0
  291. package/src/screens/Payment.tsx +224 -0
  292. package/src/screens/PaymentStatus.tsx +595 -0
  293. package/src/screens/ReviewKYC.tsx +1062 -0
  294. package/src/state/paymentSession.ts +13 -0
  295. package/src/store/fdListSelectedSlice.ts +42 -0
  296. package/src/store/hooks.ts +6 -0
  297. package/src/store/index.ts +3 -0
  298. package/src/store/onboardingSlice.ts +37 -0
  299. package/src/store/store.ts +27 -0
  300. package/src/theme/ThemeContext.tsx +84 -0
  301. package/src/theme/colors.ts +90 -0
  302. package/src/theme/index.ts +85 -0
  303. package/src/theme/shadows.ts +61 -0
  304. package/src/theme/typography.ts +151 -0
  305. package/src/types/dataTypes.ts +37 -0
  306. package/src/types/env.d.ts +93 -0
  307. package/src/types/workflowTypes.ts +12 -0
  308. package/src/utils/apiLogger.ts +166 -0
  309. package/src/utils/encryption.ts +159 -0
  310. package/src/utils/getFDData.ts +165 -0
  311. package/src/utils/globalData.ts +7 -0
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, ActivityIndicator } from 'react-native';
3
+ import { useColors, useTypography } from '../theme/ThemeContext';
4
+
5
+ export interface LoadingIndicatorProps {
6
+ message?: string;
7
+ size?: 'small' | 'large';
8
+ color?: string;
9
+ containerStyle?: object;
10
+ messageStyle?: object;
11
+ showMessage?: boolean;
12
+ overlay?: boolean;
13
+ }
14
+
15
+ const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
16
+ message = 'Loading...',
17
+ size = 'large',
18
+ color,
19
+ containerStyle,
20
+ messageStyle,
21
+ showMessage = true,
22
+ overlay = false,
23
+ }) => {
24
+ const colors = useColors();
25
+ const typography = useTypography();
26
+ const styles = createStyles(colors, typography, overlay);
27
+
28
+ const indicatorColor = color || colors.primary;
29
+
30
+ return (
31
+ <View style={[styles.container, containerStyle]}>
32
+ <ActivityIndicator size={size} color={indicatorColor} />
33
+ {showMessage && message && (
34
+ <Text style={[styles.message, messageStyle]}>{message}</Text>
35
+ )}
36
+ </View>
37
+ );
38
+ };
39
+
40
+ const createStyles = (colors: any, typography: any, overlay: boolean) => StyleSheet.create({
41
+ container: {
42
+ alignItems: 'center',
43
+ justifyContent: 'center',
44
+ padding: 20,
45
+ ...(overlay && {
46
+ position: 'absolute',
47
+ top: 0,
48
+ left: 0,
49
+ right: 0,
50
+ bottom: 0,
51
+ backgroundColor: 'rgba(255, 255, 255, 0.9)',
52
+ zIndex: 1000,
53
+ }),
54
+ },
55
+ message: {
56
+ ...typography.styles.bodyMedium,
57
+ color: colors.textLight,
58
+ marginTop: 12,
59
+ textAlign: 'center',
60
+ },
61
+ });
62
+
63
+ export default LoadingIndicator;
@@ -0,0 +1,213 @@
1
+ import React, { useRef, useEffect } from 'react';
2
+ import { View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native';
3
+ import { useColors, useTypography, useTheme } from '../theme/ThemeContext';
4
+
5
+ export interface OTPInputProps {
6
+ length?: number;
7
+ value: string[];
8
+ onChangeText: (value: string, index: number) => void;
9
+ onKeyPress?: (key: string, index: number) => void;
10
+ instruction?: string;
11
+ sessionTime?: number;
12
+ onResend?: () => void;
13
+ isResendEnabled?: boolean;
14
+ autoFocus?: boolean;
15
+ error?: boolean;
16
+ errorMessage?: string;
17
+ disabled?: boolean;
18
+ }
19
+
20
+ const OTPInput: React.FC<OTPInputProps> = ({
21
+ length = 6,
22
+ value,
23
+ onChangeText,
24
+ onKeyPress,
25
+ instruction = "Enter the 6-digit OTP that sent to your registered Aadhaar number",
26
+ sessionTime,
27
+ onResend,
28
+ isResendEnabled = false,
29
+ autoFocus = true,
30
+ error = false,
31
+ errorMessage,
32
+ disabled = false,
33
+ }) => {
34
+ const colors = useColors();
35
+ const typography = useTypography();
36
+ const { themeName } = useTheme();
37
+ const styles = createStyles(colors, typography, themeName);
38
+ const inputRefs = useRef<TextInput[]>([]);
39
+ const [resendCountdown, setResendCountdown] = React.useState<number>(60);
40
+ const [showTimerText, setShowTimerText] = React.useState<boolean>(true);
41
+
42
+ useEffect(() => {
43
+ if (autoFocus && inputRefs.current[0]) {
44
+ inputRefs.current[0].focus();
45
+ }
46
+ }, [autoFocus]);
47
+
48
+ // Start countdown timer for resend OTP
49
+ useEffect(() => {
50
+ if (resendCountdown <= 0) return;
51
+ const timer = setInterval(() => {
52
+ setResendCountdown((prev) => (prev > 0 ? prev - 1 : 0));
53
+ }, 1000);
54
+ return () => clearInterval(timer);
55
+ }, [resendCountdown]);
56
+
57
+ // Handle resend button press
58
+ const handleResendPress = () => {
59
+ if (onResend && isResendEnabled) {
60
+ // Call the resend function - parent will handle timer state
61
+ onResend();
62
+ }
63
+ };
64
+
65
+ const formatResendTime = (seconds: number): string => {
66
+ const mm = Math.floor(seconds / 60).toString().padStart(2, '0');
67
+ const ss = (seconds % 60).toString().padStart(2, '0');
68
+ return `${mm}:${ss}`;
69
+ };
70
+
71
+ const handleChangeText = (text: string, index: number) => {
72
+ onChangeText(text, index);
73
+
74
+ // Auto-focus next field
75
+ if (text && index < length - 1) {
76
+ inputRefs.current[index + 1]?.focus();
77
+ }
78
+ };
79
+
80
+ const handleKeyPress = (key: string, index: number) => {
81
+ if (onKeyPress) {
82
+ onKeyPress(key, index);
83
+ }
84
+
85
+ // Auto-focus previous field on backspace
86
+ if (key === 'Backspace' && !value[index] && index > 0) {
87
+ inputRefs.current[index - 1]?.focus();
88
+ }
89
+ };
90
+
91
+ return (
92
+ <View>
93
+ <Text style={styles.instruction}>{instruction}</Text>
94
+
95
+ <View style={styles.otpContainer}>
96
+ {Array.from({ length }, (_, index) => (
97
+ <TextInput
98
+ key={index}
99
+ ref={(ref) => {
100
+ if (ref) inputRefs.current[index] = ref;
101
+ }}
102
+ style={[
103
+ styles.otpInput,
104
+ error && styles.otpInputError,
105
+ disabled && styles.otpInputDisabled
106
+ ]}
107
+ value={value[index] || ''}
108
+ onChangeText={(text) => handleChangeText(text, index)}
109
+ onKeyPress={({ nativeEvent }) => handleKeyPress(nativeEvent.key, index)}
110
+ keyboardType="numeric"
111
+ maxLength={1}
112
+ textAlign="center"
113
+ editable={!disabled}
114
+ />
115
+ ))}
116
+ </View>
117
+
118
+ {/* Show timer only when sessionTime > 0 and resend is not enabled */}
119
+ {(sessionTime || 0) > 0 && !isResendEnabled && (
120
+ <Text style={styles.sessionText}>
121
+ Resend OTP in {formatResendTime(sessionTime || 0)}
122
+ </Text>
123
+ )}
124
+
125
+ {/* Show resend button only when resend is enabled */}
126
+ {onResend && isResendEnabled && (
127
+ <View style={styles.resendContainer}>
128
+ <Text style={styles.resendText}>Didn't receive any code? </Text>
129
+ <TouchableOpacity onPress={handleResendPress} disabled={!isResendEnabled}>
130
+ <Text style={[
131
+ styles.resendLink,
132
+ !isResendEnabled && styles.resendLinkDisabled,
133
+ ]}>
134
+ Resend code
135
+ </Text>
136
+ </TouchableOpacity>
137
+ </View>
138
+ )}
139
+ </View>
140
+ );
141
+ };
142
+
143
+ const createStyles = (colors: any, typography: any, themeName: string) => StyleSheet.create({
144
+ instruction: {
145
+ ...typography.styles.bodySmall,
146
+ paddingHorizontal: 40,
147
+ color: colors.textLight,
148
+ marginBottom: 24,
149
+ marginTop: 24,
150
+ lineHeight: 16,
151
+ textAlign: 'center',
152
+ },
153
+ otpContainer: {
154
+ flexDirection: 'row',
155
+ justifyContent: 'center',
156
+ marginBottom: 16,
157
+ gap: 8,
158
+ },
159
+ otpInput: {
160
+ width: 48,
161
+ height: 48,
162
+ borderWidth: 1,
163
+ borderColor: themeName === 'dark' ? colors.inputBorder : colors.primary,
164
+ borderRadius: 8,
165
+ ...typography.styles.bodyLarge,
166
+ color: colors.text,
167
+ backgroundColor: themeName === 'dark' ? colors.inputBackground : 'white',
168
+ },
169
+ otpInputError: {
170
+ borderColor: colors.error,
171
+ borderWidth: 2,
172
+ },
173
+ otpInputDisabled: {
174
+ backgroundColor: colors.backgroundLight,
175
+ borderColor: colors.border,
176
+ opacity: 0.6,
177
+ },
178
+ errorText: {
179
+ ...typography.styles.bodySmall,
180
+ color: colors.error,
181
+ textAlign: 'center',
182
+ marginTop: 8,
183
+ marginBottom: 8,
184
+ },
185
+ sessionText: {
186
+ ...typography.styles.bodySmall,
187
+ color: colors.textLight,
188
+ marginBottom: 3,
189
+ marginTop: 5,
190
+ textAlign: 'center',
191
+ },
192
+ resendContainer: {
193
+ flexDirection: 'row',
194
+ alignItems: 'center',
195
+ marginTop: 10,
196
+ justifyContent: 'center',
197
+ },
198
+ resendText: {
199
+ ...typography.styles.bodySmall,
200
+ color: colors.textLight,
201
+ },
202
+ resendLink: {
203
+ ...typography.styles.bodySmall,
204
+ color: colors.primary,
205
+ fontWeight: '500',
206
+ textDecorationLine: 'underline',
207
+ },
208
+ resendLinkDisabled: {
209
+ color: colors.textLight,
210
+ },
211
+ });
212
+
213
+ export default OTPInput;
@@ -0,0 +1,120 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet } from 'react-native';
3
+ import { useColors, useTypography, useTheme } from '../theme/ThemeContext';
4
+ import { getBorderColor } from '../theme';
5
+
6
+ export interface PaymentDetailsCardProps {
7
+ companyName: string;
8
+ amount: number;
9
+ fdRate: string;
10
+ tenure: string;
11
+ interestPayout: string;
12
+ showCompanyLine?: boolean;
13
+ customStyles?: {
14
+ card?: object;
15
+ companyName?: object;
16
+ companyLine?: object;
17
+ detailsContainer?: object;
18
+ detailRow?: object;
19
+ detailLabel?: object;
20
+ detailValue?: object;
21
+ };
22
+ }
23
+
24
+ const PaymentDetailsCard: React.FC<PaymentDetailsCardProps> = ({
25
+ companyName,
26
+ amount,
27
+ fdRate,
28
+ tenure,
29
+ interestPayout,
30
+ showCompanyLine = true,
31
+ customStyles = {},
32
+ }) => {
33
+ const colors = useColors();
34
+ const typography = useTypography();
35
+ const { themeName } = useTheme();
36
+ const styles = createStyles(colors, typography, themeName);
37
+
38
+ const formatAmount = (amount: number): string => {
39
+ return amount.toLocaleString('en-IN');
40
+ };
41
+
42
+ return (
43
+ <View style={[styles.card, customStyles.card]}>
44
+ <Text style={[styles.companyName, customStyles.companyName]}>
45
+ {companyName}
46
+ </Text>
47
+
48
+ {showCompanyLine && (
49
+ <View style={[styles.companyLine, customStyles.companyLine]} />
50
+ )}
51
+
52
+ <View style={[styles.detailsContainer, customStyles.detailsContainer]}>
53
+ <View style={[styles.detailRow, customStyles.detailRow]}>
54
+ <Text style={[styles.detailLabel, customStyles.detailLabel]}>Amount</Text>
55
+ <Text style={[styles.detailValue, customStyles.detailValue]}>
56
+ ₹ {formatAmount(amount)}
57
+ </Text>
58
+ </View>
59
+
60
+ <View style={[styles.detailRow, customStyles.detailRow]}>
61
+ <Text style={[styles.detailLabel, customStyles.detailLabel]}>FD Rate</Text>
62
+ <Text style={[styles.detailValue, customStyles.detailValue]}>{fdRate}</Text>
63
+ </View>
64
+
65
+ <View style={[styles.detailRow, customStyles.detailRow]}>
66
+ <Text style={[styles.detailLabel, customStyles.detailLabel]}>Tenure</Text>
67
+ <Text style={[styles.detailValue, customStyles.detailValue]}>{tenure}</Text>
68
+ </View>
69
+
70
+ <View style={[styles.detailRow, customStyles.detailRow]}>
71
+ <Text style={[styles.detailLabel, customStyles.detailLabel]}>Interest Payout</Text>
72
+ <Text style={[styles.detailValue, customStyles.detailValue]}>{interestPayout}</Text>
73
+ </View>
74
+ </View>
75
+ </View>
76
+ );
77
+ };
78
+
79
+ const createStyles = (colors: any, typography: any, themeName: string) => StyleSheet.create({
80
+ card: {
81
+ backgroundColor: themeName === 'dark' ? '#0B2940' : '#0B2940',
82
+ borderRadius: 16,
83
+ padding: 20,
84
+ alignItems: 'flex-start',
85
+ marginHorizontal: 16,
86
+ borderWidth: 1,
87
+ borderColor: '#1F4C73',
88
+ },
89
+ companyName: {
90
+ ...typography.styles.h3,
91
+ color: '#FFFFFF',
92
+ marginBottom: 12,
93
+ },
94
+ companyLine: {
95
+ height: 1,
96
+ backgroundColor: '#1F4C73',
97
+ marginBottom: 12,
98
+ width: '100%',
99
+ },
100
+ detailsContainer: {
101
+ width: '100%',
102
+ },
103
+ detailRow: {
104
+ flexDirection: 'row',
105
+ justifyContent: 'space-between',
106
+ alignItems: 'center',
107
+ paddingVertical: 8,
108
+ },
109
+ detailLabel: {
110
+ ...typography.styles.text12Regular,
111
+ color: '#BFD5F6',
112
+ },
113
+ detailValue: {
114
+ ...typography.styles.text14Medium,
115
+ color: '#FFFFFF',
116
+ lineHeight: (typography.styles.text14Medium?.lineHeight ?? typography.styles.text14Medium?.fontSize ?? 14) + 3,
117
+ },
118
+ });
119
+
120
+ export default PaymentDetailsCard;
@@ -0,0 +1,237 @@
1
+ import React from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ Modal,
8
+ Dimensions,
9
+ SafeAreaView,
10
+ ActivityIndicator,
11
+ Image,
12
+ Platform,
13
+ } from 'react-native';
14
+ import Icon from 'react-native-vector-icons/Ionicons';
15
+ import ActiveFDCard from './ActiveFDCard';
16
+ import ActionButton from './ActionButton';
17
+ import { useColors, useTypography, useSpacing, useTheme } from '../theme/ThemeContext';
18
+ import type { ColorScheme } from '../theme';
19
+ import { base64Images } from '../constants/strings/base64Images';
20
+
21
+ interface PendingFDData {
22
+ name: string;
23
+ invested: number;
24
+ value: number;
25
+ returns: number;
26
+ maturityDate: string;
27
+ logoType?: 'shriram' | 'mahindra';
28
+ }
29
+
30
+ export interface PendingFDBottomSheetProps {
31
+ visible: boolean;
32
+ onClose: () => void;
33
+ onContinue: () => void;
34
+ onBookNew: () => void;
35
+ pendingFDData?: PendingFDData;
36
+ isBookingNewLoading?: boolean;
37
+ }
38
+
39
+ const PendingFDBottomSheet: React.FC<PendingFDBottomSheetProps> = ({
40
+ visible,
41
+ onClose,
42
+ onContinue,
43
+ onBookNew,
44
+ pendingFDData = {
45
+ name: 'FD Finance Ltd',
46
+ invested: 5000,
47
+ value: 5038,
48
+ returns: 7.53,
49
+ maturityDate: 'Nov 2024',
50
+ },
51
+ isBookingNewLoading = false,
52
+ }) => {
53
+ const colors = useColors();
54
+ const typography = useTypography();
55
+ const spacing = useSpacing();
56
+ const { themeName } = useTheme();
57
+ const styles = createStyles(colors, typography, spacing, themeName);
58
+
59
+ return (
60
+ <Modal
61
+ visible={visible}
62
+ transparent
63
+ animationType="slide"
64
+ onRequestClose={onClose}
65
+ >
66
+ <View style={styles.overlay}>
67
+ <View style={styles.bottomSheet}>
68
+ <SafeAreaView style={styles.safeArea}>
69
+ {/* Header */}
70
+ <View style={styles.header}>
71
+ <View style={styles.headerContent}>
72
+ <Text style={styles.title}>
73
+ Please Wait! You also have a pending journey with progress saved:
74
+ </Text>
75
+ <TouchableOpacity
76
+ style={styles.closeButton}
77
+ onPress={onClose}
78
+ >
79
+ <Image
80
+ source={{ uri: base64Images.cross }}
81
+ style={{ width: 14, height: 14 }}
82
+ resizeMode="contain"
83
+ />
84
+ </TouchableOpacity>
85
+ </View>
86
+ </View>
87
+
88
+ {/* Pending FDs Section */}
89
+ <View style={styles.content}>
90
+ <Text style={styles.sectionTitle}>Pending FDs</Text>
91
+
92
+ {/* Active FD Card */}
93
+ <ActiveFDCard
94
+ name={pendingFDData.name}
95
+ invested={pendingFDData.invested}
96
+ value={pendingFDData.value}
97
+ returns={pendingFDData.returns}
98
+ maturityDate={pendingFDData.maturityDate}
99
+ logoType={pendingFDData.logoType}
100
+ />
101
+
102
+ {/* Action Buttons */}
103
+ <TouchableOpacity
104
+ style={[styles.bookNewButton, isBookingNewLoading && styles.disabledButton]}
105
+ onPress={onBookNew}
106
+ disabled={isBookingNewLoading}
107
+ >
108
+ {isBookingNewLoading ? (
109
+ <View style={styles.loadingContainer}>
110
+ <ActivityIndicator size="small" color={colors.primary} />
111
+ <Text style={[styles.bookNewText, { marginLeft: spacing.sm }]}>
112
+ Terminating workflow...
113
+ </Text>
114
+ </View>
115
+ ) : (
116
+ <Text style={styles.bookNewText}>
117
+ No, I want to book a new FD
118
+ </Text>
119
+ )}
120
+ </TouchableOpacity>
121
+
122
+ {themeName === 'dark' ? (
123
+ <ActionButton
124
+ title="Continue"
125
+ onPress={onContinue}
126
+ variant="primary"
127
+ style={styles.continueButtonWrapper}
128
+ />
129
+ ) : (
130
+ <TouchableOpacity
131
+ style={styles.continueButton}
132
+ onPress={onContinue}
133
+ >
134
+ <Text style={styles.continueButtonText}>Continue</Text>
135
+ </TouchableOpacity>
136
+ )}
137
+ </View>
138
+ </SafeAreaView>
139
+ </View>
140
+ </View>
141
+ </Modal>
142
+ );
143
+ };
144
+
145
+ const createStyles = (colors: ColorScheme, typography: any, spacing: any, themeName: string) => StyleSheet.create({
146
+ overlay: {
147
+ flex: 1,
148
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
149
+ justifyContent: 'flex-end',
150
+ },
151
+ bottomSheet: {
152
+ padding: spacing.sm,
153
+ backgroundColor: themeName === 'dark' ? colors.background : 'white',
154
+ borderTopLeftRadius: 20,
155
+ borderTopRightRadius: 20,
156
+ borderWidth: themeName === 'dark' ? 1 : 0,
157
+ borderColor: themeName === 'dark' ? '#ffffff' : 'transparent',
158
+ maxHeight: Dimensions.get('window').height * 0.8,
159
+ minHeight: Platform.OS === 'ios' ? 430 : 400,
160
+ },
161
+ safeArea: {
162
+ flex: 1,
163
+ },
164
+ header: {
165
+ paddingHorizontal: spacing.lg,
166
+ paddingTop: spacing.md,
167
+ paddingBottom: spacing.sm,
168
+ },
169
+ headerContent: {
170
+ flexDirection: 'row',
171
+ justifyContent: 'space-between',
172
+ alignItems: 'flex-start',
173
+ },
174
+ title: {
175
+ fontSize: 17,
176
+ fontWeight: '500',
177
+ color: themeName === 'dark' ? colors.labelColor : '#333',
178
+ flex: 1,
179
+ marginRight: spacing.md,
180
+ lineHeight: 24,
181
+ },
182
+ closeButton: {
183
+ width: 32,
184
+ height: 32,
185
+ borderRadius: 16,
186
+ backgroundColor: '#f5f5f5',
187
+ justifyContent: 'center',
188
+ alignItems: 'center',
189
+ },
190
+ content: {
191
+ flex: 1,
192
+ paddingHorizontal: spacing.lg,
193
+ paddingTop: spacing.lg,
194
+ paddingBottom: Platform.OS === 'ios' ? 20 : 0,
195
+ },
196
+ sectionTitle: {
197
+ ...typography.styles.h3,
198
+ color: themeName === 'dark' ? colors.labelColor : '#333',
199
+ marginBottom: spacing.md,
200
+ },
201
+ bookNewButton: {
202
+ marginTop: spacing.xxxl,
203
+ marginBottom: spacing.xxxl,
204
+ alignItems: 'center',
205
+ },
206
+ bookNewText: {
207
+ ...typography.styles.body2,
208
+ color: themeName === 'dark' ? colors.labelColor : '#000000',
209
+ },
210
+ disabledButton: {
211
+ opacity: 0.6,
212
+ },
213
+ loadingContainer: {
214
+ flexDirection: 'row',
215
+ alignItems: 'center',
216
+ justifyContent: 'center',
217
+ },
218
+ continueButtonWrapper: {
219
+ marginBottom: Platform.OS === 'ios' ? spacing.lg + 20 : spacing.lg,
220
+ },
221
+ continueButton: {
222
+ height: 50,
223
+ backgroundColor: '#007AFF',
224
+ borderRadius: 25,
225
+ paddingHorizontal: spacing.lg,
226
+ alignItems: 'center',
227
+ justifyContent: 'center',
228
+ marginBottom: Platform.OS === 'ios' ? spacing.lg + 20 : spacing.lg,
229
+ },
230
+ continueButtonText: {
231
+ ...typography.styles.button,
232
+ color: 'white',
233
+ fontWeight: '600',
234
+ },
235
+ });
236
+
237
+ export default PendingFDBottomSheet;