@finspringinnovations/fdsdk 0.0.1
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.
- package/README.md +184 -0
- package/lib/api/applicationApi.d.ts +1 -0
- package/lib/api/applicationApi.js +11 -0
- package/lib/api/bankApi.d.ts +352 -0
- package/lib/api/bankApi.js +54 -0
- package/lib/api/baseApi.d.ts +8 -0
- package/lib/api/baseApi.js +456 -0
- package/lib/api/customerApi.d.ts +855 -0
- package/lib/api/customerApi.js +213 -0
- package/lib/api/fdApi.d.ts +979 -0
- package/lib/api/fdApi.js +112 -0
- package/lib/api/fdCalculatorApi.d.ts +179 -0
- package/lib/api/fdCalculatorApi.js +36 -0
- package/lib/api/index.d.ts +14 -0
- package/lib/api/index.js +45 -0
- package/lib/api/interestRateApi.d.ts +585 -0
- package/lib/api/interestRateApi.js +101 -0
- package/lib/api/kycApi.d.ts +486 -0
- package/lib/api/kycApi.js +71 -0
- package/lib/api/masterDataApi.d.ts +158 -0
- package/lib/api/masterDataApi.js +32 -0
- package/lib/api/nomineeApi.d.ts +325 -0
- package/lib/api/nomineeApi.js +46 -0
- package/lib/api/onboardingApi.d.ts +192 -0
- package/lib/api/onboardingApi.js +41 -0
- package/lib/api/panApi.d.ts +0 -0
- package/lib/api/panApi.js +23 -0
- package/lib/api/paymentApi.d.ts +325 -0
- package/lib/api/paymentApi.js +46 -0
- package/lib/api/workflowApi.d.ts +654 -0
- package/lib/api/workflowApi.js +90 -0
- package/lib/assets/images/images.d.ts +4 -0
- package/lib/assets/images/images.js +10 -0
- package/lib/components/AadhaarInput.d.ts +13 -0
- package/lib/components/AadhaarInput.js +47 -0
- package/lib/components/ActionButton.d.ts +12 -0
- package/lib/components/ActionButton.js +87 -0
- package/lib/components/ActiveFDCard.d.ts +16 -0
- package/lib/components/ActiveFDCard.js +95 -0
- package/lib/components/AmountInput.d.ts +20 -0
- package/lib/components/AmountInput.js +144 -0
- package/lib/components/CheckboxOption.d.ts +11 -0
- package/lib/components/CheckboxOption.js +41 -0
- package/lib/components/CompanyHeader.d.ts +7 -0
- package/lib/components/CompanyHeader.js +57 -0
- package/lib/components/DropdownSelector.d.ts +9 -0
- package/lib/components/DropdownSelector.js +49 -0
- package/lib/components/EmptyState.d.ts +17 -0
- package/lib/components/EmptyState.js +44 -0
- package/lib/components/ErrorDisplay.d.ts +17 -0
- package/lib/components/ErrorDisplay.js +69 -0
- package/lib/components/FAQItem.d.ts +9 -0
- package/lib/components/FAQItem.js +52 -0
- package/lib/components/FDCard.d.ts +21 -0
- package/lib/components/FDCard.js +96 -0
- package/lib/components/FormDropdown.d.ts +18 -0
- package/lib/components/FormDropdown.js +155 -0
- package/lib/components/FormSection.d.ts +14 -0
- package/lib/components/FormSection.js +38 -0
- package/lib/components/Header.d.ts +14 -0
- package/lib/components/Header.js +52 -0
- package/lib/components/IFSCSearchResultCard.d.ts +13 -0
- package/lib/components/IFSCSearchResultCard.js +70 -0
- package/lib/components/InfoBox.d.ts +8 -0
- package/lib/components/InfoBox.js +39 -0
- package/lib/components/InterestRateCard.d.ts +8 -0
- package/lib/components/InterestRateCard.js +46 -0
- package/lib/components/LoadingIndicator.d.ts +12 -0
- package/lib/components/LoadingIndicator.js +30 -0
- package/lib/components/OTPInput.d.ts +17 -0
- package/lib/components/OTPInput.js +144 -0
- package/lib/components/PaymentDetailsCard.d.ts +20 -0
- package/lib/components/PaymentDetailsCard.js +68 -0
- package/lib/components/PendingFDBottomSheet.d.ts +18 -0
- package/lib/components/PendingFDBottomSheet.js +122 -0
- package/lib/components/SafeAreaWrapper.d.ts +13 -0
- package/lib/components/SafeAreaWrapper.js +41 -0
- package/lib/components/ScreenHeader.d.ts +11 -0
- package/lib/components/ScreenHeader.js +46 -0
- package/lib/components/StatusDisplay.d.ts +15 -0
- package/lib/components/StatusDisplay.js +88 -0
- package/lib/components/TextFieldWithLabel.d.ts +46 -0
- package/lib/components/TextFieldWithLabel.js +326 -0
- package/lib/components/TrustBox.d.ts +8 -0
- package/lib/components/TrustBox.js +45 -0
- package/lib/components/ValidationErrorAlert.d.ts +23 -0
- package/lib/components/ValidationErrorAlert.js +39 -0
- package/lib/components/ValidationMessage.d.ts +9 -0
- package/lib/components/ValidationMessage.js +98 -0
- package/lib/components/index.d.ts +35 -0
- package/lib/components/index.js +64 -0
- package/lib/config/apiConfig.d.ts +34 -0
- package/lib/config/apiConfig.js +158 -0
- package/lib/config/appDataConfig.d.ts +114 -0
- package/lib/config/appDataConfig.js +264 -0
- package/lib/config/encryptionConfig.d.ts +21 -0
- package/lib/config/encryptionConfig.js +61 -0
- package/lib/config/workflowConstants.d.ts +37 -0
- package/lib/config/workflowConstants.js +38 -0
- package/lib/constants/strings/bank.d.ts +72 -0
- package/lib/constants/strings/bank.js +86 -0
- package/lib/constants/strings/base64Images.d.ts +25 -0
- package/lib/constants/strings/base64Images.js +28 -0
- package/lib/constants/strings/common.d.ts +53 -0
- package/lib/constants/strings/common.js +62 -0
- package/lib/constants/strings/employee.d.ts +61 -0
- package/lib/constants/strings/employee.js +77 -0
- package/lib/constants/strings/faq.d.ts +14 -0
- package/lib/constants/strings/faq.js +20 -0
- package/lib/constants/strings/fd.d.ts +122 -0
- package/lib/constants/strings/fd.js +151 -0
- package/lib/constants/strings/home.d.ts +49 -0
- package/lib/constants/strings/home.js +62 -0
- package/lib/constants/strings/index.d.ts +16 -0
- package/lib/constants/strings/index.js +44 -0
- package/lib/constants/strings/kyc.d.ts +80 -0
- package/lib/constants/strings/kyc.js +94 -0
- package/lib/constants/strings/nominee.d.ts +64 -0
- package/lib/constants/strings/nominee.js +81 -0
- package/lib/hooks/useAuth.d.ts +25 -0
- package/lib/hooks/useAuth.js +39 -0
- package/lib/hooks/useFDData.d.ts +11 -0
- package/lib/hooks/useFDData.js +40 -0
- package/lib/index.d.ts +69 -0
- package/lib/index.js +182 -0
- package/lib/navigation/RootNavigator.d.ts +8 -0
- package/lib/navigation/RootNavigator.js +205 -0
- package/lib/navigation/SimpleNavigator.d.ts +11 -0
- package/lib/navigation/SimpleNavigator.js +107 -0
- package/lib/navigation/helpers.d.ts +11 -0
- package/lib/navigation/helpers.js +83 -0
- package/lib/navigation/index.d.ts +15 -0
- package/lib/navigation/index.js +42 -0
- package/lib/navigation/types.d.ts +113 -0
- package/lib/navigation/types.js +2 -0
- package/lib/navigation/workflowNavigator.d.ts +22 -0
- package/lib/navigation/workflowNavigator.js +104 -0
- package/lib/providers/ApiProvider.d.ts +7 -0
- package/lib/providers/ApiProvider.js +34 -0
- package/lib/providers/MasterDataProvider.d.ts +10 -0
- package/lib/providers/MasterDataProvider.js +54 -0
- package/lib/screens/AadhaarVerification.d.ts +7 -0
- package/lib/screens/AadhaarVerification.js +627 -0
- package/lib/screens/AddBankAccount.d.ts +22 -0
- package/lib/screens/AddBankAccount.js +381 -0
- package/lib/screens/BankDetail.d.ts +16 -0
- package/lib/screens/BankDetail.js +596 -0
- package/lib/screens/BookFD.d.ts +0 -0
- package/lib/screens/BookFD.js +315 -0
- package/lib/screens/Employee.d.ts +18 -0
- package/lib/screens/Employee.js +594 -0
- package/lib/screens/FDCalculator.d.ts +18 -0
- package/lib/screens/FDCalculator.js +759 -0
- package/lib/screens/FDList.d.ts +27 -0
- package/lib/screens/FDList.js +1008 -0
- package/lib/screens/FindIFSC.d.ts +16 -0
- package/lib/screens/FindIFSC.js +248 -0
- package/lib/screens/Home.d.ts +0 -0
- package/lib/screens/Home.js +143 -0
- package/lib/screens/NomineeDetail.d.ts +17 -0
- package/lib/screens/NomineeDetail.js +592 -0
- package/lib/screens/PayNow.d.ts +14 -0
- package/lib/screens/PayNow.js +230 -0
- package/lib/screens/Payment.d.ts +11 -0
- package/lib/screens/Payment.js +191 -0
- package/lib/screens/PaymentStatus.d.ts +16 -0
- package/lib/screens/PaymentStatus.js +397 -0
- package/lib/screens/ReviewKYC.d.ts +21 -0
- package/lib/screens/ReviewKYC.js +660 -0
- package/lib/state/paymentSession.d.ts +8 -0
- package/lib/state/paymentSession.js +13 -0
- package/lib/store/fdListSelectedSlice.d.ts +21 -0
- package/lib/store/fdListSelectedSlice.js +26 -0
- package/lib/store/hooks.d.ts +8 -0
- package/lib/store/hooks.js +31 -0
- package/lib/store/index.d.ts +3 -0
- package/lib/store/index.js +8 -0
- package/lib/store/onboardingSlice.d.ts +12 -0
- package/lib/store/onboardingSlice.js +32 -0
- package/lib/store/store.d.ts +13 -0
- package/lib/store/store.js +33 -0
- package/lib/theme/ThemeContext.d.ts +210 -0
- package/lib/theme/ThemeContext.js +90 -0
- package/lib/theme/colors.d.ts +80 -0
- package/lib/theme/colors.js +85 -0
- package/lib/theme/index.d.ts +34 -0
- package/lib/theme/index.js +69 -0
- package/lib/theme/shadows.d.ts +53 -0
- package/lib/theme/shadows.js +58 -0
- package/lib/theme/typography.d.ts +134 -0
- package/lib/theme/typography.js +143 -0
- package/lib/types/dataTypes.d.ts +34 -0
- package/lib/types/dataTypes.js +2 -0
- package/lib/types/workflowTypes.d.ts +2 -0
- package/lib/types/workflowTypes.js +2 -0
- package/lib/utils/apiLogger.d.ts +48 -0
- package/lib/utils/apiLogger.js +105 -0
- package/lib/utils/encryption.d.ts +28 -0
- package/lib/utils/encryption.js +113 -0
- package/lib/utils/getFDData.d.ts +48 -0
- package/lib/utils/getFDData.js +154 -0
- package/lib/utils/globalData.d.ts +2 -0
- package/lib/utils/globalData.js +10 -0
- package/package.json +76 -0
- package/src/api/applicationApi.ts +12 -0
- package/src/api/bankApi.ts +42 -0
- package/src/api/baseApi.ts +513 -0
- package/src/api/customerApi.ts +291 -0
- package/src/api/fdApi.ts +150 -0
- package/src/api/fdCalculatorApi.ts +41 -0
- package/src/api/index.ts +29 -0
- package/src/api/interestRateApi.ts +143 -0
- package/src/api/kycApi.ts +63 -0
- package/src/api/masterDataApi.ts +34 -0
- package/src/api/nomineeApi.ts +34 -0
- package/src/api/onboardingApi.ts +64 -0
- package/src/api/panApi.ts +25 -0
- package/src/api/paymentApi.ts +34 -0
- package/src/api/workflowApi.ts +94 -0
- package/src/assets/images/arrow-filled.png +0 -0
- package/src/assets/images/arrow-left.png +0 -0
- package/src/assets/images/backicon.png +0 -0
- package/src/assets/images/calendar.png +0 -0
- package/src/assets/images/chevron-down.png +0 -0
- package/src/assets/images/chevron-down@2x.png +0 -0
- package/src/assets/images/chevron-down@3x.png +0 -0
- package/src/assets/images/images.js +8 -0
- package/src/components/AadhaarInput.tsx +91 -0
- package/src/components/ActionButton.tsx +129 -0
- package/src/components/ActiveFDCard.tsx +158 -0
- package/src/components/AmountInput.tsx +217 -0
- package/src/components/CheckboxOption.tsx +93 -0
- package/src/components/CompanyHeader.tsx +78 -0
- package/src/components/DropdownSelector.tsx +77 -0
- package/src/components/EmptyState.tsx +109 -0
- package/src/components/ErrorDisplay.tsx +135 -0
- package/src/components/FAQItem.tsx +90 -0
- package/src/components/FDCard.tsx +165 -0
- package/src/components/FormDropdown.tsx +214 -0
- package/src/components/FormSection.tsx +86 -0
- package/src/components/Header.tsx +110 -0
- package/src/components/IFSCSearchResultCard.tsx +139 -0
- package/src/components/InfoBox.tsx +55 -0
- package/src/components/InterestRateCard.tsx +77 -0
- package/src/components/LoadingIndicator.tsx +63 -0
- package/src/components/OTPInput.tsx +213 -0
- package/src/components/PaymentDetailsCard.tsx +120 -0
- package/src/components/PendingFDBottomSheet.tsx +235 -0
- package/src/components/README.md +210 -0
- package/src/components/SafeAreaWrapper.tsx +68 -0
- package/src/components/ScreenHeader.tsx +83 -0
- package/src/components/StatusDisplay.tsx +139 -0
- package/src/components/TextFieldWithLabel.tsx +502 -0
- package/src/components/TrustBox.tsx +63 -0
- package/src/components/ValidationErrorAlert.tsx +57 -0
- package/src/components/ValidationMessage.tsx +134 -0
- package/src/components/index.tsx +47 -0
- package/src/config/apiConfig.ts +217 -0
- package/src/config/appDataConfig.ts +279 -0
- package/src/config/encryptionConfig.ts +65 -0
- package/src/config/workflowConstants.ts +43 -0
- package/src/constants/strings/README.md +146 -0
- package/src/constants/strings/bank.ts +92 -0
- package/src/constants/strings/base64Images.ts +29 -0
- package/src/constants/strings/common.ts +63 -0
- package/src/constants/strings/employee.ts +85 -0
- package/src/constants/strings/faq.ts +23 -0
- package/src/constants/strings/fd.ts +172 -0
- package/src/constants/strings/home.ts +67 -0
- package/src/constants/strings/index.ts +21 -0
- package/src/constants/strings/kyc.ts +100 -0
- package/src/constants/strings/nominee.ts +90 -0
- package/src/hooks/useAuth.ts +42 -0
- package/src/hooks/useFDData.ts +48 -0
- package/src/index.tsx +173 -0
- package/src/navigation/RootNavigator.tsx +352 -0
- package/src/navigation/SimpleNavigator.tsx +107 -0
- package/src/navigation/helpers.ts +85 -0
- package/src/navigation/index.tsx +81 -0
- package/src/navigation/types.ts +124 -0
- package/src/navigation/workflowNavigator.ts +131 -0
- package/src/providers/ApiProvider.tsx +43 -0
- package/src/providers/MasterDataProvider.tsx +30 -0
- package/src/screens/AadhaarVerification.tsx +809 -0
- package/src/screens/AddBankAccount.tsx +541 -0
- package/src/screens/BankDetail.tsx +826 -0
- package/src/screens/BookFD.tsx +330 -0
- package/src/screens/Employee.tsx +822 -0
- package/src/screens/FDCalculator.tsx +987 -0
- package/src/screens/FDList.tsx +1284 -0
- package/src/screens/FindIFSC.tsx +332 -0
- package/src/screens/Home.tsx +152 -0
- package/src/screens/NomineeDetail.tsx +800 -0
- package/src/screens/PayNow.tsx +282 -0
- package/src/screens/Payment.tsx +224 -0
- package/src/screens/PaymentStatus.tsx +561 -0
- package/src/screens/ReviewKYC.tsx +956 -0
- package/src/state/paymentSession.ts +13 -0
- package/src/store/fdListSelectedSlice.ts +42 -0
- package/src/store/hooks.ts +27 -0
- package/src/store/index.ts +3 -0
- package/src/store/onboardingSlice.ts +37 -0
- package/src/store/store.ts +35 -0
- package/src/theme/ThemeContext.tsx +82 -0
- package/src/theme/colors.ts +90 -0
- package/src/theme/index.ts +64 -0
- package/src/theme/shadows.ts +61 -0
- package/src/theme/typography.ts +151 -0
- package/src/types/dataTypes.ts +37 -0
- package/src/types/env.d.ts +93 -0
- package/src/types/workflowTypes.ts +12 -0
- package/src/utils/apiLogger.ts +166 -0
- package/src/utils/encryption.ts +159 -0
- package/src/utils/getFDData.ts +175 -0
- package/src/utils/globalData.ts +7 -0
|
@@ -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,235 @@
|
|
|
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
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface PendingFDBottomSheetProps {
|
|
30
|
+
visible: boolean;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
onContinue: () => void;
|
|
33
|
+
onBookNew: () => void;
|
|
34
|
+
pendingFDData?: PendingFDData;
|
|
35
|
+
isBookingNewLoading?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const PendingFDBottomSheet: React.FC<PendingFDBottomSheetProps> = ({
|
|
39
|
+
visible,
|
|
40
|
+
onClose,
|
|
41
|
+
onContinue,
|
|
42
|
+
onBookNew,
|
|
43
|
+
pendingFDData = {
|
|
44
|
+
name: 'Shriram Finance Ltd',
|
|
45
|
+
invested: 5000,
|
|
46
|
+
value: 5038,
|
|
47
|
+
returns: 7.53,
|
|
48
|
+
maturityDate: 'Nov 2024',
|
|
49
|
+
},
|
|
50
|
+
isBookingNewLoading = false,
|
|
51
|
+
}) => {
|
|
52
|
+
const colors = useColors();
|
|
53
|
+
const typography = useTypography();
|
|
54
|
+
const spacing = useSpacing();
|
|
55
|
+
const { themeName } = useTheme();
|
|
56
|
+
const styles = createStyles(colors, typography, spacing, themeName);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Modal
|
|
60
|
+
visible={visible}
|
|
61
|
+
transparent
|
|
62
|
+
animationType="slide"
|
|
63
|
+
onRequestClose={onClose}
|
|
64
|
+
>
|
|
65
|
+
<View style={styles.overlay}>
|
|
66
|
+
<View style={styles.bottomSheet}>
|
|
67
|
+
<SafeAreaView style={styles.safeArea}>
|
|
68
|
+
{/* Header */}
|
|
69
|
+
<View style={styles.header}>
|
|
70
|
+
<View style={styles.headerContent}>
|
|
71
|
+
<Text style={styles.title}>
|
|
72
|
+
Please Wait! You also have a pending journey with progress saved:
|
|
73
|
+
</Text>
|
|
74
|
+
<TouchableOpacity
|
|
75
|
+
style={styles.closeButton}
|
|
76
|
+
onPress={onClose}
|
|
77
|
+
>
|
|
78
|
+
<Image
|
|
79
|
+
source={{ uri: base64Images.cross }}
|
|
80
|
+
style={{ width: 14, height: 14 }}
|
|
81
|
+
resizeMode="contain"
|
|
82
|
+
/>
|
|
83
|
+
</TouchableOpacity>
|
|
84
|
+
</View>
|
|
85
|
+
</View>
|
|
86
|
+
|
|
87
|
+
{/* Pending FDs Section */}
|
|
88
|
+
<View style={styles.content}>
|
|
89
|
+
<Text style={styles.sectionTitle}>Pending FDs</Text>
|
|
90
|
+
|
|
91
|
+
{/* Active FD Card */}
|
|
92
|
+
<ActiveFDCard
|
|
93
|
+
name={pendingFDData.name}
|
|
94
|
+
invested={pendingFDData.invested}
|
|
95
|
+
value={pendingFDData.value}
|
|
96
|
+
returns={pendingFDData.returns}
|
|
97
|
+
maturityDate={pendingFDData.maturityDate}
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
{/* Action Buttons */}
|
|
101
|
+
<TouchableOpacity
|
|
102
|
+
style={[styles.bookNewButton, isBookingNewLoading && styles.disabledButton]}
|
|
103
|
+
onPress={onBookNew}
|
|
104
|
+
disabled={isBookingNewLoading}
|
|
105
|
+
>
|
|
106
|
+
{isBookingNewLoading ? (
|
|
107
|
+
<View style={styles.loadingContainer}>
|
|
108
|
+
<ActivityIndicator size="small" color={colors.primary} />
|
|
109
|
+
<Text style={[styles.bookNewText, { marginLeft: spacing.sm }]}>
|
|
110
|
+
Terminating workflow...
|
|
111
|
+
</Text>
|
|
112
|
+
</View>
|
|
113
|
+
) : (
|
|
114
|
+
<Text style={styles.bookNewText}>
|
|
115
|
+
No, I want to book a new FD
|
|
116
|
+
</Text>
|
|
117
|
+
)}
|
|
118
|
+
</TouchableOpacity>
|
|
119
|
+
|
|
120
|
+
{themeName === 'dark' ? (
|
|
121
|
+
<ActionButton
|
|
122
|
+
title="Continue"
|
|
123
|
+
onPress={onContinue}
|
|
124
|
+
variant="primary"
|
|
125
|
+
style={styles.continueButtonWrapper}
|
|
126
|
+
/>
|
|
127
|
+
) : (
|
|
128
|
+
<TouchableOpacity
|
|
129
|
+
style={styles.continueButton}
|
|
130
|
+
onPress={onContinue}
|
|
131
|
+
>
|
|
132
|
+
<Text style={styles.continueButtonText}>Continue</Text>
|
|
133
|
+
</TouchableOpacity>
|
|
134
|
+
)}
|
|
135
|
+
</View>
|
|
136
|
+
</SafeAreaView>
|
|
137
|
+
</View>
|
|
138
|
+
</View>
|
|
139
|
+
</Modal>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const createStyles = (colors: ColorScheme, typography: any, spacing: any, themeName: string) => StyleSheet.create({
|
|
144
|
+
overlay: {
|
|
145
|
+
flex: 1,
|
|
146
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
147
|
+
justifyContent: 'flex-end',
|
|
148
|
+
},
|
|
149
|
+
bottomSheet: {
|
|
150
|
+
padding: spacing.sm,
|
|
151
|
+
backgroundColor: themeName === 'dark' ? colors.background : 'white',
|
|
152
|
+
borderTopLeftRadius: 20,
|
|
153
|
+
borderTopRightRadius: 20,
|
|
154
|
+
borderWidth: themeName === 'dark' ? 1 : 0,
|
|
155
|
+
borderColor: themeName === 'dark' ? '#ffffff' : 'transparent',
|
|
156
|
+
maxHeight: Dimensions.get('window').height * 0.8,
|
|
157
|
+
minHeight: Platform.OS === 'ios' ? 430 : 400,
|
|
158
|
+
},
|
|
159
|
+
safeArea: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
},
|
|
162
|
+
header: {
|
|
163
|
+
paddingHorizontal: spacing.lg,
|
|
164
|
+
paddingTop: spacing.md,
|
|
165
|
+
paddingBottom: spacing.sm,
|
|
166
|
+
},
|
|
167
|
+
headerContent: {
|
|
168
|
+
flexDirection: 'row',
|
|
169
|
+
justifyContent: 'space-between',
|
|
170
|
+
alignItems: 'flex-start',
|
|
171
|
+
},
|
|
172
|
+
title: {
|
|
173
|
+
fontSize: 17,
|
|
174
|
+
fontWeight: '500',
|
|
175
|
+
color: themeName === 'dark' ? colors.labelColor : '#333',
|
|
176
|
+
flex: 1,
|
|
177
|
+
marginRight: spacing.md,
|
|
178
|
+
lineHeight: 24,
|
|
179
|
+
},
|
|
180
|
+
closeButton: {
|
|
181
|
+
width: 32,
|
|
182
|
+
height: 32,
|
|
183
|
+
borderRadius: 16,
|
|
184
|
+
backgroundColor: '#f5f5f5',
|
|
185
|
+
justifyContent: 'center',
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
},
|
|
188
|
+
content: {
|
|
189
|
+
flex: 1,
|
|
190
|
+
paddingHorizontal: spacing.lg,
|
|
191
|
+
paddingTop: spacing.lg,
|
|
192
|
+
paddingBottom: Platform.OS === 'ios' ? 20 : 0,
|
|
193
|
+
},
|
|
194
|
+
sectionTitle: {
|
|
195
|
+
...typography.styles.h3,
|
|
196
|
+
color: themeName === 'dark' ? colors.labelColor : '#333',
|
|
197
|
+
marginBottom: spacing.md,
|
|
198
|
+
},
|
|
199
|
+
bookNewButton: {
|
|
200
|
+
marginTop: spacing.xxxl,
|
|
201
|
+
marginBottom: spacing.xxxl,
|
|
202
|
+
alignItems: 'center',
|
|
203
|
+
},
|
|
204
|
+
bookNewText: {
|
|
205
|
+
...typography.styles.body2,
|
|
206
|
+
color: themeName === 'dark' ? colors.labelColor : '#000000',
|
|
207
|
+
},
|
|
208
|
+
disabledButton: {
|
|
209
|
+
opacity: 0.6,
|
|
210
|
+
},
|
|
211
|
+
loadingContainer: {
|
|
212
|
+
flexDirection: 'row',
|
|
213
|
+
alignItems: 'center',
|
|
214
|
+
justifyContent: 'center',
|
|
215
|
+
},
|
|
216
|
+
continueButtonWrapper: {
|
|
217
|
+
marginBottom: Platform.OS === 'ios' ? spacing.lg + 20 : spacing.lg,
|
|
218
|
+
},
|
|
219
|
+
continueButton: {
|
|
220
|
+
height: 50,
|
|
221
|
+
backgroundColor: '#007AFF',
|
|
222
|
+
borderRadius: 25,
|
|
223
|
+
paddingHorizontal: spacing.lg,
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
justifyContent: 'center',
|
|
226
|
+
marginBottom: Platform.OS === 'ios' ? spacing.lg + 20 : spacing.lg,
|
|
227
|
+
},
|
|
228
|
+
continueButtonText: {
|
|
229
|
+
...typography.styles.button,
|
|
230
|
+
color: 'white',
|
|
231
|
+
fontWeight: '600',
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
export default PendingFDBottomSheet;
|