@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,332 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Alert, Image, BackHandler, Platform } from 'react-native';
|
|
3
|
+
import SafeAreaWrapper from '../components/SafeAreaWrapper';
|
|
4
|
+
import { Header, IFSCSearchResultCard } from '../components';
|
|
5
|
+
import ActionButton from '../components/ActionButton';
|
|
6
|
+
import ValidationMessage from '../components/ValidationMessage';
|
|
7
|
+
import TextFieldWithLabel from '../components/TextFieldWithLabel';
|
|
8
|
+
import { useColors, useTypography, useTheme } from '../theme/ThemeContext';
|
|
9
|
+
import { getBorderColor } from '../theme';
|
|
10
|
+
import { useFdBankDetailsSearchMutation } from '../api/fdApi';
|
|
11
|
+
import { useAppSelector } from '../store';
|
|
12
|
+
import { base64Images } from '../constants/strings/base64Images';
|
|
13
|
+
import { BANK_STRINGS } from '../constants/strings/bank';
|
|
14
|
+
import { COMMON_STRINGS } from '../constants/strings/common';
|
|
15
|
+
import { navigate } from '../navigation/helpers';
|
|
16
|
+
|
|
17
|
+
export interface FindIFSCProps {
|
|
18
|
+
onGoBack?: () => void;
|
|
19
|
+
onSelect?: (ifscData: IFSCData) => void;
|
|
20
|
+
initialSearchTerm?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface IFSCData {
|
|
24
|
+
bankName: string;
|
|
25
|
+
branchName: string;
|
|
26
|
+
ifscCode: string;
|
|
27
|
+
bankShortDesc?: string;
|
|
28
|
+
bankCode?: string;
|
|
29
|
+
customerBankPk?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const FindIFSC: React.FC<FindIFSCProps> = ({ onGoBack, onSelect, initialSearchTerm }) => {
|
|
33
|
+
|
|
34
|
+
const colors = useColors();
|
|
35
|
+
const typography = useTypography();
|
|
36
|
+
const { themeName } = useTheme();
|
|
37
|
+
const styles = createStyles(colors, typography, themeName);
|
|
38
|
+
|
|
39
|
+
// Get providerId from app data or use default
|
|
40
|
+
const defaultProviderId = useAppSelector((state: any) => state?.onboarding?.providerId);// Default Shriram provider ID
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// FD Bank Details API
|
|
44
|
+
const [fdBankDetails, {
|
|
45
|
+
data: fdBankDetailsResponse,
|
|
46
|
+
error: fdBankDetailsError,
|
|
47
|
+
isLoading: isLoadingFDBankDetails,
|
|
48
|
+
}] = useFdBankDetailsSearchMutation();
|
|
49
|
+
|
|
50
|
+
const [searchTerm, setSearchTerm] = useState(initialSearchTerm || '');
|
|
51
|
+
const [searchResults, setSearchResults] = useState<IFSCData[]>([]);
|
|
52
|
+
const [hasSearched, setHasSearched] = useState(false);
|
|
53
|
+
const [ifscError, setIfscError] = useState<string>('');
|
|
54
|
+
|
|
55
|
+
// FD bank details API status monitored
|
|
56
|
+
|
|
57
|
+
// Strict IFSC validation: 4 letters, then 0, then 6 alphanumeric
|
|
58
|
+
const validateIFSC = (ifsc: string): boolean => {
|
|
59
|
+
const ifscRegex = /^[A-Z]{4}0[A-Z0-9]{6}$/;
|
|
60
|
+
return ifscRegex.test(ifsc);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Search function with FD bank details API call
|
|
64
|
+
const handleSearch = async () => {
|
|
65
|
+
if (!searchTerm.trim()) {
|
|
66
|
+
Alert.alert(COMMON_STRINGS.REQUIRED_FIELD, BANK_STRINGS.IFSC_INSTRUCTIONS);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const upper = searchTerm.trim().toUpperCase();
|
|
71
|
+
if (!validateIFSC(upper)) {
|
|
72
|
+
Alert.alert(BANK_STRINGS.INVALID_IFSC_CODE, BANK_STRINGS.IFSC_CODE_NOT_FOUND);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setHasSearched(true);
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
|
|
80
|
+
// Prepare FD bank details request data
|
|
81
|
+
const fdBankDetailsRequest = {
|
|
82
|
+
providerId: defaultProviderId,
|
|
83
|
+
ifscCode: upper,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const response = await fdBankDetails(fdBankDetailsRequest).unwrap();
|
|
87
|
+
|
|
88
|
+
// Transform API response to IFSCData format
|
|
89
|
+
let searchResults: IFSCData[] = [];
|
|
90
|
+
|
|
91
|
+
// Handle the actual API response structure
|
|
92
|
+
if (response && response.data && Array.isArray(response.data) && response.data.length > 0) {
|
|
93
|
+
const bankData = response.data[0];
|
|
94
|
+
searchResults = [{
|
|
95
|
+
bankName: bankData.BnkDescr || '',
|
|
96
|
+
branchName: bankData.BankBranch || '',
|
|
97
|
+
ifscCode: bankData.IfscCode || '',
|
|
98
|
+
bankShortDesc: bankData.BnkShrtDescr || '',
|
|
99
|
+
bankCode: bankData.Code || '',
|
|
100
|
+
customerBankPk: bankData.intCustbnk_pk || '',
|
|
101
|
+
}];
|
|
102
|
+
} else if (response && response.bankName && response.branchName && response.ifscCode) {
|
|
103
|
+
// Fallback for old response format
|
|
104
|
+
searchResults = [{
|
|
105
|
+
bankName: response.bankName,
|
|
106
|
+
branchName: response.branchName,
|
|
107
|
+
ifscCode: response.ifscCode,
|
|
108
|
+
}];
|
|
109
|
+
} else {
|
|
110
|
+
searchResults = [];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Set search results to display in card
|
|
114
|
+
setSearchResults(searchResults);
|
|
115
|
+
|
|
116
|
+
} catch (error) {
|
|
117
|
+
|
|
118
|
+
// Set empty results when API fails
|
|
119
|
+
setSearchResults([]);
|
|
120
|
+
setHasSearched(true);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const handleCancel = () => {
|
|
125
|
+
setSearchTerm('');
|
|
126
|
+
setSearchResults([]);
|
|
127
|
+
setHasSearched(false);
|
|
128
|
+
navigate('AddBankAccount');
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const handleSelect = (ifscData: IFSCData) => {
|
|
132
|
+
|
|
133
|
+
onSelect?.(ifscData);
|
|
134
|
+
// Note: onGoBack is not needed since we're using replace in navigation
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Handler for back button (used by both header and hardware back button)
|
|
138
|
+
const handleBackPress = () => {
|
|
139
|
+
navigate('AddBankAccount');
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// Handle Android hardware back button
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (Platform.OS !== 'android') return;
|
|
145
|
+
|
|
146
|
+
const onHardwareBackPress = () => {
|
|
147
|
+
handleBackPress();
|
|
148
|
+
return true; // Prevent default behavior
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const backHandler = BackHandler.addEventListener(
|
|
152
|
+
'hardwareBackPress',
|
|
153
|
+
onHardwareBackPress
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
return () => backHandler.remove();
|
|
157
|
+
}, []);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<SafeAreaWrapper
|
|
161
|
+
includeTop={false}
|
|
162
|
+
bottomPadding={25}
|
|
163
|
+
statusBarColor="#000000"
|
|
164
|
+
statusBarStyle="light-content"
|
|
165
|
+
>
|
|
166
|
+
<Header
|
|
167
|
+
title={BANK_STRINGS.FIND_IFSC_TITLE}
|
|
168
|
+
onBackPress={handleBackPress}
|
|
169
|
+
backgroundColor={colors.primary}
|
|
170
|
+
/>
|
|
171
|
+
|
|
172
|
+
<ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
|
|
173
|
+
<View style={styles.searchSection}>
|
|
174
|
+
<TextFieldWithLabel
|
|
175
|
+
label=""
|
|
176
|
+
value={searchTerm}
|
|
177
|
+
onChangeText={(text) => {
|
|
178
|
+
// Convert to uppercase and allow only alphanumeric
|
|
179
|
+
const cleaned = text.toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
180
|
+
setSearchTerm(cleaned);
|
|
181
|
+
// Show inline error as user types when format is invalid
|
|
182
|
+
if (cleaned.length > 0 && !validateIFSC(cleaned)) {
|
|
183
|
+
setIfscError(BANK_STRINGS.INVALID_IFSC_CODE);
|
|
184
|
+
} else {
|
|
185
|
+
setIfscError('');
|
|
186
|
+
}
|
|
187
|
+
// Clear any shown results when user edits IFSC
|
|
188
|
+
if (hasSearched || searchResults.length) {
|
|
189
|
+
setHasSearched(false);
|
|
190
|
+
setSearchResults([]);
|
|
191
|
+
}
|
|
192
|
+
}}
|
|
193
|
+
placeholder={BANK_STRINGS.IFSC_CODE_PLACEHOLDER}
|
|
194
|
+
variant="text"
|
|
195
|
+
maxLength={11}
|
|
196
|
+
autoCapitalize="characters"
|
|
197
|
+
/>
|
|
198
|
+
|
|
199
|
+
{ifscError ? (
|
|
200
|
+
<View style={{ marginTop: -15 }}>
|
|
201
|
+
<ValidationMessage type="error" message={ifscError} visible={true} />
|
|
202
|
+
</View>
|
|
203
|
+
) : null}
|
|
204
|
+
|
|
205
|
+
<ActionButton
|
|
206
|
+
title={isLoadingFDBankDetails ? COMMON_STRINGS.SEARCHING : BANK_STRINGS.FIND_IFSC_BUTTON}
|
|
207
|
+
onPress={handleSearch}
|
|
208
|
+
disabled={!validateIFSC(searchTerm.trim().toUpperCase()) || isLoadingFDBankDetails}
|
|
209
|
+
style={styles.findButton}
|
|
210
|
+
/>
|
|
211
|
+
|
|
212
|
+
<TouchableOpacity style={styles.cancelButton} onPress={handleCancel}>
|
|
213
|
+
<Text style={styles.cancelText}>{COMMON_STRINGS.CANCEL}</Text>
|
|
214
|
+
</TouchableOpacity>
|
|
215
|
+
|
|
216
|
+
</View>
|
|
217
|
+
|
|
218
|
+
{hasSearched && searchResults.length > 0 && (
|
|
219
|
+
<View style={styles.resultsSection}>
|
|
220
|
+
<Text style={styles.resultsTitle}>Search Results</Text>
|
|
221
|
+
{searchResults.map((result, index) => {
|
|
222
|
+
return (
|
|
223
|
+
<IFSCSearchResultCard
|
|
224
|
+
key={index}
|
|
225
|
+
bankName={result.bankName}
|
|
226
|
+
branchName={result.branchName}
|
|
227
|
+
ifscCode={result.ifscCode}
|
|
228
|
+
bankShortDesc={result.bankShortDesc}
|
|
229
|
+
bankCode={result.bankCode}
|
|
230
|
+
onSelect={() => {
|
|
231
|
+
handleSelect(result);
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
);
|
|
235
|
+
})}
|
|
236
|
+
</View>
|
|
237
|
+
)}
|
|
238
|
+
|
|
239
|
+
{hasSearched && searchResults.length === 0 && (
|
|
240
|
+
<View style={styles.noResultsContainer}>
|
|
241
|
+
<Text style={styles.noResultsText}>{BANK_STRINGS.IFSC_NOT_FOUND}</Text>
|
|
242
|
+
<Text style={styles.noResultsSubtext}>{BANK_STRINGS.IFSC_CODE_NOT_FOUND}</Text>
|
|
243
|
+
<TouchableOpacity style={{ marginTop: 16 }} onPress={onGoBack}>
|
|
244
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
245
|
+
<Image source={{ uri: base64Images.search }} style={{ width: 16, height: 16, marginRight: 8 }} />
|
|
246
|
+
<Text style={styles.findIFSCText}>{BANK_STRINGS.FIND_IFSC_BUTTON}</Text>
|
|
247
|
+
</View>
|
|
248
|
+
</TouchableOpacity>
|
|
249
|
+
</View>
|
|
250
|
+
)}
|
|
251
|
+
</ScrollView>
|
|
252
|
+
</SafeAreaWrapper>
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const createStyles = (colors: any, typography: any, themeName: string) => StyleSheet.create({
|
|
257
|
+
container: {
|
|
258
|
+
flex: 1,
|
|
259
|
+
paddingHorizontal: 16,
|
|
260
|
+
paddingTop: 20,
|
|
261
|
+
},
|
|
262
|
+
searchSection: {
|
|
263
|
+
marginBottom: 24,
|
|
264
|
+
},
|
|
265
|
+
findButton: {
|
|
266
|
+
padding: 12,
|
|
267
|
+
paddingHorizontal: 20,
|
|
268
|
+
height: 50,
|
|
269
|
+
width: 330,
|
|
270
|
+
alignSelf: 'center',
|
|
271
|
+
},
|
|
272
|
+
cancelButton: {
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
marginHorizontal: 16,
|
|
275
|
+
marginBottom: 24,
|
|
276
|
+
padding: 12,
|
|
277
|
+
paddingHorizontal: 20,
|
|
278
|
+
borderRadius: themeName === 'dark' ? 10 : 30,
|
|
279
|
+
borderWidth: themeName === 'dark' ? 1 : 0.5,
|
|
280
|
+
borderColor: themeName === 'dark' ? '#ffffff' : getBorderColor({ colors } as any, 0.36),
|
|
281
|
+
backgroundColor: themeName === 'dark' ? colors.cancelButtonBg : colors.background,
|
|
282
|
+
height: 50,
|
|
283
|
+
width: 330,
|
|
284
|
+
alignSelf: 'center',
|
|
285
|
+
justifyContent: 'center',
|
|
286
|
+
},
|
|
287
|
+
findIFSCText: {
|
|
288
|
+
...typography.styles.bodyMedium,
|
|
289
|
+
color: colors.primary,
|
|
290
|
+
},
|
|
291
|
+
cancelText: {
|
|
292
|
+
...typography.styles.bodyLarge,
|
|
293
|
+
color: themeName === 'dark' ? '#ffffff' : colors.primary,
|
|
294
|
+
},
|
|
295
|
+
resultsSection: {
|
|
296
|
+
marginTop: 8,
|
|
297
|
+
},
|
|
298
|
+
resultsTitle: {
|
|
299
|
+
...typography.styles.bodyMedium,
|
|
300
|
+
color: colors.textLight,
|
|
301
|
+
marginBottom: 16,
|
|
302
|
+
},
|
|
303
|
+
noResultsContainer: {
|
|
304
|
+
alignItems: 'center',
|
|
305
|
+
paddingVertical: 40,
|
|
306
|
+
},
|
|
307
|
+
noResultsText: {
|
|
308
|
+
...typography.styles.bodyLarge,
|
|
309
|
+
fontWeight: typography.fontWeight.semiBold,
|
|
310
|
+
color: colors.text,
|
|
311
|
+
marginBottom: 8,
|
|
312
|
+
},
|
|
313
|
+
noResultsSubtext: {
|
|
314
|
+
fontSize: 14,
|
|
315
|
+
color: colors.textLight,
|
|
316
|
+
textAlign: 'center',
|
|
317
|
+
},
|
|
318
|
+
debugButton: {
|
|
319
|
+
paddingHorizontal: 16,
|
|
320
|
+
paddingVertical: 12,
|
|
321
|
+
borderRadius: 8,
|
|
322
|
+
marginBottom: 16,
|
|
323
|
+
alignItems: 'center',
|
|
324
|
+
},
|
|
325
|
+
debugButtonText: {
|
|
326
|
+
...typography.styles.bodyMedium,
|
|
327
|
+
fontWeight: '600',
|
|
328
|
+
},
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
export default FindIFSC;
|
|
332
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import {
|
|
3
|
+
// View,
|
|
4
|
+
// Text,
|
|
5
|
+
// StyleSheet,
|
|
6
|
+
// TouchableOpacity,
|
|
7
|
+
// Platform,
|
|
8
|
+
// } from 'react-native';
|
|
9
|
+
// import { useTheme, useColors, useTypography, useShadows, useSpacing } from '../theme/ThemeContext';
|
|
10
|
+
// import type { ColorScheme } from '../theme';
|
|
11
|
+
// import SafeAreaWrapper from '../components/SafeAreaWrapper';
|
|
12
|
+
|
|
13
|
+
// // Enable Fast Refresh for this module
|
|
14
|
+
// if (__DEV__) {
|
|
15
|
+
// // @ts-ignore
|
|
16
|
+
// module.hot?.accept();
|
|
17
|
+
// }
|
|
18
|
+
|
|
19
|
+
// export interface HomeProps {
|
|
20
|
+
// onNavigateToBookFD?: () => void;
|
|
21
|
+
// onNavigateToFDList?: () => void;
|
|
22
|
+
// customStyles?: {
|
|
23
|
+
// container?: object;
|
|
24
|
+
// title?: object;
|
|
25
|
+
// button?: object;
|
|
26
|
+
// buttonText?: object;
|
|
27
|
+
// };
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
// const Home: React.FC<HomeProps> = ({
|
|
31
|
+
// onNavigateToBookFD,
|
|
32
|
+
// onNavigateToFDList,
|
|
33
|
+
// customStyles = {},
|
|
34
|
+
// }) => {
|
|
35
|
+
// const colors = useColors();
|
|
36
|
+
// const typography = useTypography();
|
|
37
|
+
// const shadows = useShadows();
|
|
38
|
+
// const spacing = useSpacing();
|
|
39
|
+
|
|
40
|
+
// const styles = createStyles(colors, typography, shadows, spacing);
|
|
41
|
+
|
|
42
|
+
// return (
|
|
43
|
+
// <SafeAreaWrapper
|
|
44
|
+
// style={customStyles.container}
|
|
45
|
+
// statusBarColor="#f8f9fa"
|
|
46
|
+
// statusBarStyle="dark-content"
|
|
47
|
+
// >
|
|
48
|
+
// <View style={styles.content}>
|
|
49
|
+
// <Text style={[styles.title, customStyles.title]}>
|
|
50
|
+
// Shriram FD SDK
|
|
51
|
+
// </Text>
|
|
52
|
+
// <Text style={styles.subtitle}>
|
|
53
|
+
// Manage your Fixed Deposits with ease
|
|
54
|
+
// </Text>
|
|
55
|
+
|
|
56
|
+
// <View style={styles.buttonContainer}>
|
|
57
|
+
// <TouchableOpacity
|
|
58
|
+
// style={[styles.button, customStyles.button]}
|
|
59
|
+
// onPress={onNavigateToFDList}
|
|
60
|
+
// activeOpacity={0.8}
|
|
61
|
+
// >
|
|
62
|
+
// <Text style={[styles.buttonText, customStyles.buttonText]}>
|
|
63
|
+
// View My FDs
|
|
64
|
+
// </Text>
|
|
65
|
+
// </TouchableOpacity>
|
|
66
|
+
|
|
67
|
+
// <TouchableOpacity
|
|
68
|
+
// style={[styles.button, styles.secondaryButton, customStyles.button]}
|
|
69
|
+
// onPress={onNavigateToBookFD}
|
|
70
|
+
// activeOpacity={0.8}
|
|
71
|
+
// >
|
|
72
|
+
// <Text style={[styles.buttonText, styles.secondaryButtonText, customStyles.buttonText]}>
|
|
73
|
+
// Book New FD
|
|
74
|
+
// </Text>
|
|
75
|
+
// </TouchableOpacity>
|
|
76
|
+
// </View>
|
|
77
|
+
|
|
78
|
+
// <View style={styles.infoContainer}>
|
|
79
|
+
// <Text style={styles.infoText}>
|
|
80
|
+
// Platform: {Platform.OS}
|
|
81
|
+
// </Text>
|
|
82
|
+
// <Text style={styles.infoText}>
|
|
83
|
+
// SDK Version: 1.0.0
|
|
84
|
+
// </Text>
|
|
85
|
+
// </View>
|
|
86
|
+
// </View>
|
|
87
|
+
// </SafeAreaWrapper>
|
|
88
|
+
// );
|
|
89
|
+
// };
|
|
90
|
+
|
|
91
|
+
// const createStyles = (colors: ColorScheme, typography: any, shadows: any, spacing: any) => StyleSheet.create({
|
|
92
|
+
// container: {
|
|
93
|
+
// flex: 1,
|
|
94
|
+
// backgroundColor: colors.background,
|
|
95
|
+
// },
|
|
96
|
+
// content: {
|
|
97
|
+
// flex: 1,
|
|
98
|
+
// justifyContent: 'center',
|
|
99
|
+
// alignItems: 'center',
|
|
100
|
+
// paddingHorizontal: spacing.xl,
|
|
101
|
+
// },
|
|
102
|
+
// title: {
|
|
103
|
+
// ...typography.styles.h1,
|
|
104
|
+
// color: colors.text,
|
|
105
|
+
// marginBottom: spacing.md,
|
|
106
|
+
// textAlign: 'center',
|
|
107
|
+
// },
|
|
108
|
+
// subtitle: {
|
|
109
|
+
// ...typography.styles.bodyMedium,
|
|
110
|
+
// color: colors.textSecondary,
|
|
111
|
+
// marginBottom: spacing.xxxl,
|
|
112
|
+
// textAlign: 'center',
|
|
113
|
+
// },
|
|
114
|
+
// buttonContainer: {
|
|
115
|
+
// width: '100%',
|
|
116
|
+
// marginBottom: spacing.xxxl,
|
|
117
|
+
// gap: spacing.lg,
|
|
118
|
+
// },
|
|
119
|
+
// button: {
|
|
120
|
+
// backgroundColor: colors.tabSelected,
|
|
121
|
+
// paddingVertical: spacing.lg,
|
|
122
|
+
// paddingHorizontal: spacing.xl,
|
|
123
|
+
// borderRadius: 8,
|
|
124
|
+
// alignItems: 'center',
|
|
125
|
+
// ...shadows.default,
|
|
126
|
+
// },
|
|
127
|
+
// secondaryButton: {
|
|
128
|
+
// backgroundColor: 'transparent',
|
|
129
|
+
// borderWidth: 2,
|
|
130
|
+
// borderColor: colors.tabSelected,
|
|
131
|
+
// shadowOpacity: 0,
|
|
132
|
+
// elevation: 0,
|
|
133
|
+
// },
|
|
134
|
+
// buttonText: {
|
|
135
|
+
// ...typography.styles.button,
|
|
136
|
+
// color: colors.background,
|
|
137
|
+
// },
|
|
138
|
+
// secondaryButtonText: {
|
|
139
|
+
// color: colors.tabSelected,
|
|
140
|
+
// },
|
|
141
|
+
// infoContainer: {
|
|
142
|
+
// alignItems: 'center',
|
|
143
|
+
// },
|
|
144
|
+
// infoText: {
|
|
145
|
+
// ...typography.styles.text12Regular,
|
|
146
|
+
// color: colors.textSecondary,
|
|
147
|
+
// marginTop: spacing.xs,
|
|
148
|
+
// },
|
|
149
|
+
// });
|
|
150
|
+
|
|
151
|
+
// export { Home };
|
|
152
|
+
// export default Home;
|