@airxpay/sdk-ui 1.0.3 → 1.0.6
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 +186 -216
- package/dist/api/merchant.d.ts +11 -0
- package/dist/api/{seller.js → merchant.js} +12 -3
- package/dist/components/common/FileUploader.d.ts +1 -1
- package/dist/components/common/StepIndicator.d.ts +1 -1
- package/dist/components/steps/BankDetails.d.ts +3 -3
- package/dist/components/steps/BankDetails.js +223 -162
- package/dist/components/steps/BasicDetailsForm.d.ts +3 -3
- package/dist/components/steps/BasicDetailsForm.js +143 -144
- package/dist/components/steps/KYCVerification.d.ts +3 -3
- package/dist/components/steps/KYCVerification.js +290 -123
- package/dist/components/steps/OnboardingComplete.d.ts +3 -3
- package/dist/components/steps/OnboardingComplete.js +112 -36
- package/dist/components/ui/MerchantOnboard/MerchantOnboarding.d.ts +4 -0
- package/dist/components/ui/{SellerOnboard/SellerOnboarding.js → MerchantOnboard/MerchantOnboarding.js} +250 -79
- package/dist/contexts/AirXPayProvider.d.ts +14 -7
- package/dist/contexts/AirXPayProvider.js +40 -89
- package/dist/hooks/{SellerOnboarding.js → MerchantOnboarding.js} +2 -2
- package/dist/hooks/useAirXPayReady.d.ts +6 -0
- package/dist/hooks/useAirXPayReady.js +27 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +10 -9
- package/dist/sdk/airxpay.d.ts +1 -2
- package/dist/sdk/airxpay.js +2 -5
- package/dist/types/dev.js +1 -2
- package/dist/types/dev.ts +2 -2
- package/dist/types/{sellertypes.d.ts → merchantTypes.d.ts} +29 -14
- package/dist/types/merchantTypes.js +3 -0
- package/dist/types/merchantTypes.ts +94 -0
- package/dist/types/type.d.ts +4 -5
- package/dist/types/type.js +1 -0
- package/dist/types/type.ts +7 -5
- package/package.json +1 -1
- package/dist/api/seller.d.ts +0 -9
- package/dist/components/ui/SellerOnboard/SellerOnboarding.d.ts +0 -4
- package/dist/types/sellertypes.js +0 -4
- package/dist/types/sellertypes.ts +0 -85
- /package/dist/components/ui/{SellerOnboard → MerchantOnboard}/CustomSegmentedButtons.d.ts +0 -0
- /package/dist/components/ui/{SellerOnboard → MerchantOnboard}/CustomSegmentedButtons.js +0 -0
- /package/dist/hooks/{SellerOnboarding.d.ts → MerchantOnboarding.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Merchant, Mode } from '../../types/merchantTypes';
|
|
3
3
|
interface BankDetailsProps {
|
|
4
|
-
initialData: Partial<
|
|
4
|
+
initialData: Partial<Merchant>;
|
|
5
5
|
mode: Mode;
|
|
6
|
-
onNext: (data: Partial<
|
|
6
|
+
onNext: (data: Partial<Merchant>) => void;
|
|
7
7
|
onBack: () => void;
|
|
8
8
|
}
|
|
9
9
|
declare const BankDetails: React.FC<BankDetailsProps>;
|
|
@@ -60,10 +60,28 @@ const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
|
60
60
|
const [errors, setErrors] = (0, react_1.useState)({});
|
|
61
61
|
const [showAccountNumber, setShowAccountNumber] = (0, react_1.useState)(false);
|
|
62
62
|
const [formValid, setFormValid] = (0, react_1.useState)(false);
|
|
63
|
+
const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
|
|
64
|
+
// Check if bank details already exist
|
|
65
|
+
(0, react_1.useEffect)(() => {
|
|
66
|
+
if (initialData.bankDetails) {
|
|
67
|
+
const { accountHolderName, bankName, accountNumber, ifscCode } = initialData.bankDetails;
|
|
68
|
+
if (accountHolderName && bankName && accountNumber && ifscCode) {
|
|
69
|
+
// Form is pre-filled with existing data
|
|
70
|
+
setFormValid(true);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, [initialData]);
|
|
63
74
|
const validateIFSC = (ifsc) => {
|
|
64
75
|
const ifscRegex = /^[A-Z]{4}0[A-Z0-9]{6}$/;
|
|
65
76
|
return ifscRegex.test(ifsc);
|
|
66
77
|
};
|
|
78
|
+
const validateBankAccount = (accountNumber, ifscCode) => {
|
|
79
|
+
// Basic validation - bank code from IFSC should match account number pattern
|
|
80
|
+
// This is a simplified check - in production, you might want to use a bank validation API
|
|
81
|
+
const bankCode = ifscCode.substring(0, 4);
|
|
82
|
+
// Add bank-specific validation if needed
|
|
83
|
+
return true;
|
|
84
|
+
};
|
|
67
85
|
const validateField = (field, value) => {
|
|
68
86
|
switch (field) {
|
|
69
87
|
case 'accountHolderName':
|
|
@@ -71,28 +89,38 @@ const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
|
71
89
|
return 'Account holder name is required';
|
|
72
90
|
if (value.length < 3)
|
|
73
91
|
return 'Name must be at least 3 characters';
|
|
92
|
+
if (value.length > 50)
|
|
93
|
+
return 'Name must be less than 50 characters';
|
|
94
|
+
if (!/^[a-zA-Z\s.]+$/.test(value))
|
|
95
|
+
return 'Name contains invalid characters';
|
|
74
96
|
return undefined;
|
|
75
97
|
case 'bankName':
|
|
76
98
|
if (!(value === null || value === void 0 ? void 0 : value.trim()))
|
|
77
99
|
return 'Bank name is required';
|
|
100
|
+
if (value.length < 3)
|
|
101
|
+
return 'Bank name must be at least 3 characters';
|
|
102
|
+
if (value.length > 50)
|
|
103
|
+
return 'Bank name must be less than 50 characters';
|
|
78
104
|
return undefined;
|
|
79
105
|
case 'accountNumber':
|
|
80
106
|
if (!(value === null || value === void 0 ? void 0 : value.trim()))
|
|
81
107
|
return 'Account number is required';
|
|
82
|
-
|
|
83
|
-
|
|
108
|
+
const cleaned = value.replace(/\s/g, '');
|
|
109
|
+
if (!/^\d{9,18}$/.test(cleaned)) {
|
|
110
|
+
return 'Account number must be 9-18 digits';
|
|
84
111
|
}
|
|
85
112
|
return undefined;
|
|
86
113
|
case 'ifscCode':
|
|
87
114
|
if (!(value === null || value === void 0 ? void 0 : value.trim()))
|
|
88
115
|
return 'IFSC code is required';
|
|
89
|
-
|
|
90
|
-
|
|
116
|
+
const ifsc = value.toUpperCase().replace(/\s/g, '');
|
|
117
|
+
if (!validateIFSC(ifsc)) {
|
|
118
|
+
return 'Invalid IFSC code (e.g., SBIN0123456)';
|
|
91
119
|
}
|
|
92
120
|
return undefined;
|
|
93
121
|
case 'upiId':
|
|
94
122
|
if (value && !/^[\w.-]+@[\w.-]+$/.test(value)) {
|
|
95
|
-
return 'Invalid UPI ID format';
|
|
123
|
+
return 'Invalid UPI ID format (e.g., name@bank)';
|
|
96
124
|
}
|
|
97
125
|
return undefined;
|
|
98
126
|
default:
|
|
@@ -110,36 +138,21 @@ const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
|
110
138
|
// Check if all required fields have values
|
|
111
139
|
const allRequiredFilled = requiredFields.every(field => {
|
|
112
140
|
const value = formData[field];
|
|
113
|
-
return value && value.trim().length > 0;
|
|
141
|
+
return value && value.toString().trim().length > 0;
|
|
114
142
|
});
|
|
115
143
|
// Check if there are any errors
|
|
116
144
|
const hasNoErrors = Object.keys(errors).length === 0;
|
|
117
145
|
// Check if cheque is uploaded
|
|
118
146
|
const hasCheque = cancelledCheque !== undefined && cancelledCheque !== '';
|
|
119
|
-
// Validate each field individually for debugging
|
|
120
|
-
const fieldValues = {
|
|
121
|
-
accountHolderName: formData.accountHolderName || 'empty',
|
|
122
|
-
bankName: formData.bankName || 'empty',
|
|
123
|
-
accountNumber: formData.accountNumber || 'empty',
|
|
124
|
-
ifscCode: formData.ifscCode || 'empty',
|
|
125
|
-
cheque: cancelledCheque || 'empty'
|
|
126
|
-
};
|
|
127
|
-
const fieldErrors = Object.assign({}, errors);
|
|
128
147
|
const isValid = allRequiredFilled && hasNoErrors && hasCheque;
|
|
129
148
|
setFormValid(isValid);
|
|
130
|
-
// Debug log
|
|
131
|
-
console.log('=== Form Validation Debug ===');
|
|
132
|
-
console.log('Field Values:', fieldValues);
|
|
133
|
-
console.log('Field Errors:', fieldErrors);
|
|
134
|
-
console.log('allRequiredFilled:', allRequiredFilled);
|
|
135
|
-
console.log('hasNoErrors:', hasNoErrors);
|
|
136
|
-
console.log('hasCheque:', hasCheque);
|
|
137
|
-
console.log('Form Valid:', isValid);
|
|
138
|
-
console.log('============================');
|
|
139
149
|
}, [formData, errors, cancelledCheque]);
|
|
140
150
|
const handleChange = (field, value) => {
|
|
141
151
|
if (field === 'ifscCode') {
|
|
142
|
-
value = value.toUpperCase();
|
|
152
|
+
value = value.toUpperCase().replace(/\s/g, '');
|
|
153
|
+
}
|
|
154
|
+
if (field === 'accountNumber') {
|
|
155
|
+
value = value.replace(/\D/g, '');
|
|
143
156
|
}
|
|
144
157
|
setFormData(prev => (Object.assign(Object.assign({}, prev), { [field]: value })));
|
|
145
158
|
// Validate on change
|
|
@@ -172,6 +185,7 @@ const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
|
172
185
|
};
|
|
173
186
|
const handleChequeUpload = (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
174
187
|
setUploading(true);
|
|
188
|
+
// Simulate upload
|
|
175
189
|
setTimeout(() => {
|
|
176
190
|
setCancelledCheque(file.uri || 'uploaded_cheque.jpg');
|
|
177
191
|
setUploading(false);
|
|
@@ -209,10 +223,26 @@ const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
|
209
223
|
react_native_1.Alert.alert('Error', 'Please upload cancelled cheque');
|
|
210
224
|
return;
|
|
211
225
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
// Validate bank account combination
|
|
227
|
+
if (formData.accountNumber && formData.ifscCode) {
|
|
228
|
+
if (!validateBankAccount(formData.accountNumber, formData.ifscCode)) {
|
|
229
|
+
react_native_1.Alert.alert('Error', 'Account number and IFSC code do not match');
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Show submitting state
|
|
234
|
+
setIsSubmitting(true);
|
|
235
|
+
// Simulate submission
|
|
236
|
+
setTimeout(() => {
|
|
237
|
+
setIsSubmitting(false);
|
|
238
|
+
onNext({
|
|
239
|
+
bankDetails: Object.assign(Object.assign({}, formData), { cancelledChequeUrl: cancelledCheque }),
|
|
240
|
+
isBankDetailsCompleted: true,
|
|
241
|
+
});
|
|
242
|
+
}, 1000);
|
|
243
|
+
};
|
|
244
|
+
const handleBack = () => {
|
|
245
|
+
onBack();
|
|
216
246
|
};
|
|
217
247
|
const maskAccountNumber = (value) => {
|
|
218
248
|
const cleaned = value.replace(/\s/g, '');
|
|
@@ -222,151 +252,163 @@ const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
|
222
252
|
const masked = '•'.repeat(Math.min(cleaned.length - 4, 8));
|
|
223
253
|
return masked + last4;
|
|
224
254
|
};
|
|
225
|
-
return (<react_native_1.
|
|
226
|
-
<
|
|
227
|
-
<
|
|
228
|
-
{
|
|
229
|
-
|
|
230
|
-
<
|
|
231
|
-
<
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<react_native_1.
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
255
|
+
return (<react_native_1.KeyboardAvoidingView style={{ flex: 1 }} behavior={react_native_1.Platform.OS === 'ios' ? 'padding' : undefined} keyboardVerticalOffset={react_native_1.Platform.OS === 'ios' ? 64 : 0}>
|
|
256
|
+
<react_native_1.View style={styles.container}>
|
|
257
|
+
<expo_linear_gradient_1.LinearGradient colors={['#FFFFFF', '#F8F9FA']} style={styles.gradient}>
|
|
258
|
+
<react_native_1.ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent} keyboardShouldPersistTaps="handled">
|
|
259
|
+
{/* Header Card */}
|
|
260
|
+
<react_native_paper_1.Surface style={styles.headerCard}>
|
|
261
|
+
<react_native_1.View style={styles.headerIcon}>
|
|
262
|
+
<react_native_paper_1.IconButton icon="bank" size={24} iconColor="#0066CC"/>
|
|
263
|
+
</react_native_1.View>
|
|
264
|
+
<react_native_1.View style={styles.headerText}>
|
|
265
|
+
<react_native_1.Text style={styles.title}>Bank Details</react_native_1.Text>
|
|
266
|
+
<react_native_1.Text style={styles.subtitle}>
|
|
267
|
+
Add your bank account for settlements
|
|
268
|
+
</react_native_1.Text>
|
|
269
|
+
</react_native_1.View>
|
|
270
|
+
</react_native_paper_1.Surface>
|
|
240
271
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
272
|
+
{/* Form Card */}
|
|
273
|
+
<react_native_paper_1.Surface style={styles.formCard}>
|
|
274
|
+
{/* Progress Steps */}
|
|
275
|
+
<react_native_1.View style={styles.progressContainer}>
|
|
276
|
+
<react_native_1.View style={styles.progressStep}>
|
|
277
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotCompleted]}>
|
|
278
|
+
<react_native_paper_1.IconButton icon="check" size={12} iconColor="#FFFFFF"/>
|
|
279
|
+
</react_native_1.View>
|
|
280
|
+
<react_native_1.Text style={styles.progressTextCompleted}>Basic</react_native_1.Text>
|
|
248
281
|
</react_native_1.View>
|
|
249
|
-
<react_native_1.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
<
|
|
282
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
283
|
+
<react_native_1.View style={styles.progressStep}>
|
|
284
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotCompleted]}>
|
|
285
|
+
<react_native_paper_1.IconButton icon="check" size={12} iconColor="#FFFFFF"/>
|
|
286
|
+
</react_native_1.View>
|
|
287
|
+
<react_native_1.Text style={styles.progressTextCompleted}>KYC</react_native_1.Text>
|
|
288
|
+
</react_native_1.View>
|
|
289
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
290
|
+
<react_native_1.View style={styles.progressStep}>
|
|
291
|
+
<expo_linear_gradient_1.LinearGradient colors={['#0066CC', '#0099FF']} style={styles.progressDotActive}/>
|
|
292
|
+
<react_native_1.Text style={styles.progressTextActive}>Bank</react_native_1.Text>
|
|
255
293
|
</react_native_1.View>
|
|
256
|
-
<react_native_1.Text style={styles.progressTextCompleted}>KYC</react_native_1.Text>
|
|
257
|
-
</react_native_1.View>
|
|
258
|
-
<react_native_1.View style={styles.progressLine}/>
|
|
259
|
-
<react_native_1.View style={styles.progressStep}>
|
|
260
|
-
<expo_linear_gradient_1.LinearGradient colors={['#0066CC', '#0099FF']} style={styles.progressDotActive}/>
|
|
261
|
-
<react_native_1.Text style={styles.progressTextActive}>Bank</react_native_1.Text>
|
|
262
294
|
</react_native_1.View>
|
|
263
|
-
</react_native_1.View>
|
|
264
295
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
296
|
+
{/* Account Holder Name */}
|
|
297
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
298
|
+
<react_native_1.Text style={styles.label}>
|
|
299
|
+
Account Holder Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
300
|
+
</react_native_1.Text>
|
|
301
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.accountHolderName} onChangeText={(text) => handleChange('accountHolderName', text)} onBlur={() => handleBlur('accountHolderName')} error={!!errors.accountHolderName} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="account" color="#6B7280" size={20}/>} placeholder="John Doe" placeholderTextColor="#9CA3AF"/>
|
|
302
|
+
{errors.accountHolderName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
303
|
+
{errors.accountHolderName}
|
|
304
|
+
</react_native_paper_1.HelperText>)}
|
|
305
|
+
</react_native_1.View>
|
|
275
306
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
307
|
+
{/* Bank Name */}
|
|
308
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
309
|
+
<react_native_1.Text style={styles.label}>
|
|
310
|
+
Bank Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
311
|
+
</react_native_1.Text>
|
|
312
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.bankName} onChangeText={(text) => handleChange('bankName', text)} onBlur={() => handleBlur('bankName')} error={!!errors.bankName} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="bank" color="#6B7280" size={20}/>} placeholder="State Bank of India" placeholderTextColor="#9CA3AF"/>
|
|
313
|
+
{errors.bankName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
314
|
+
{errors.bankName}
|
|
315
|
+
</react_native_paper_1.HelperText>)}
|
|
316
|
+
</react_native_1.View>
|
|
286
317
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
318
|
+
{/* Account Number */}
|
|
319
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
320
|
+
<react_native_1.Text style={styles.label}>
|
|
321
|
+
Account Number <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
322
|
+
</react_native_1.Text>
|
|
323
|
+
<react_native_1.View>
|
|
324
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.accountNumber} onChangeText={(text) => handleChange('accountNumber', text)} onBlur={() => handleBlur('accountNumber')} keyboardType="numeric" error={!!errors.accountNumber} style={[styles.input, styles.inputWithRightIcon]} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="credit-card" color="#6B7280" size={20}/>} right={<react_native_paper_1.TextInput.Icon icon={showAccountNumber ? "eye-off" : "eye"} onPress={() => setShowAccountNumber(!showAccountNumber)} color="#6B7280" size={20}/>} placeholder="1234567890" placeholderTextColor="#9CA3AF" secureTextEntry={!showAccountNumber} maxLength={18}/>
|
|
325
|
+
</react_native_1.View>
|
|
326
|
+
{errors.accountNumber && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
327
|
+
{errors.accountNumber}
|
|
328
|
+
</react_native_paper_1.HelperText>)}
|
|
329
|
+
{formData.accountNumber && !errors.accountNumber && (<react_native_1.View style={styles.previewContainer}>
|
|
330
|
+
<react_native_paper_1.IconButton icon="eye" size={14} iconColor="#6B7280"/>
|
|
331
|
+
<react_native_1.Text style={styles.previewText}>
|
|
332
|
+
{maskAccountNumber(formData.accountNumber)}
|
|
333
|
+
</react_native_1.Text>
|
|
334
|
+
</react_native_1.View>)}
|
|
294
335
|
</react_native_1.View>
|
|
295
|
-
{errors.accountNumber && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
296
|
-
{errors.accountNumber}
|
|
297
|
-
</react_native_paper_1.HelperText>)}
|
|
298
|
-
{formData.accountNumber && !errors.accountNumber && (<react_native_1.View style={styles.previewContainer}>
|
|
299
|
-
<react_native_paper_1.IconButton icon="eye" size={14} iconColor="#6B7280"/>
|
|
300
|
-
<react_native_1.Text style={styles.previewText}>
|
|
301
|
-
{maskAccountNumber(formData.accountNumber)}
|
|
302
|
-
</react_native_1.Text>
|
|
303
|
-
</react_native_1.View>)}
|
|
304
|
-
</react_native_1.View>
|
|
305
336
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
337
|
+
{/* IFSC Code */}
|
|
338
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
339
|
+
<react_native_1.Text style={styles.label}>
|
|
340
|
+
IFSC Code <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
341
|
+
</react_native_1.Text>
|
|
342
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.ifscCode} onChangeText={(text) => handleChange('ifscCode', text)} onBlur={() => handleBlur('ifscCode')} autoCapitalize="characters" error={!!errors.ifscCode} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="qrcode" color="#6B7280" size={20}/>} placeholder="SBIN0123456" placeholderTextColor="#9CA3AF" maxLength={11}/>
|
|
343
|
+
{errors.ifscCode && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
344
|
+
{errors.ifscCode}
|
|
345
|
+
</react_native_paper_1.HelperText>)}
|
|
346
|
+
{formData.ifscCode && !errors.ifscCode && (<react_native_1.View style={styles.hintContainer}>
|
|
347
|
+
<react_native_paper_1.IconButton icon="information" size={14} iconColor="#6B7280"/>
|
|
348
|
+
<react_native_1.Text style={styles.hintText}>
|
|
349
|
+
First 4 letters, then 0, then 6 alphanumeric
|
|
350
|
+
</react_native_1.Text>
|
|
351
|
+
</react_native_1.View>)}
|
|
352
|
+
</react_native_1.View>
|
|
316
353
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
354
|
+
{/* UPI ID */}
|
|
355
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
356
|
+
<react_native_1.Text style={styles.label}>UPI ID (Optional)</react_native_1.Text>
|
|
357
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.upiId} onChangeText={(text) => handleChange('upiId', text)} onBlur={() => handleBlur('upiId')} error={!!errors.upiId} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="cellphone" color="#6B7280" size={20}/>} placeholder="name@bank" placeholderTextColor="#9CA3AF"/>
|
|
358
|
+
{errors.upiId && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
359
|
+
{errors.upiId}
|
|
360
|
+
</react_native_paper_1.HelperText>)}
|
|
361
|
+
</react_native_1.View>
|
|
325
362
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
363
|
+
{/* Cancelled Cheque Upload */}
|
|
364
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
365
|
+
<react_native_1.Text style={styles.label}>
|
|
366
|
+
Cancelled Cheque <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
367
|
+
</react_native_1.Text>
|
|
368
|
+
<FileUploader_1.default label="" required description="Upload a cancelled cheque for verification" icon="file-document" value={cancelledCheque} onUpload={handleChequeUpload} onRemove={handleChequeRemove} uploading={uploading} mode={mode} accept="image/*"/>
|
|
369
|
+
</react_native_1.View>
|
|
333
370
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
371
|
+
{/* Test Mode Notice */}
|
|
372
|
+
{mode === 'test' && (<react_native_paper_1.Surface style={styles.testModeCard}>
|
|
373
|
+
<react_native_1.View style={styles.testModeContent}>
|
|
374
|
+
<react_native_paper_1.IconButton icon="flask" size={16} iconColor="#92400E"/>
|
|
375
|
+
<react_native_1.View style={styles.testModeText}>
|
|
376
|
+
<react_native_1.Text style={styles.testModeTitle}>Test Mode Active</react_native_1.Text>
|
|
377
|
+
<react_native_1.Text style={styles.testModeDescription}>
|
|
378
|
+
Bank details are for testing only
|
|
379
|
+
</react_native_1.Text>
|
|
380
|
+
</react_native_1.View>
|
|
343
381
|
</react_native_1.View>
|
|
344
|
-
</
|
|
345
|
-
</react_native_paper_1.Surface>)}
|
|
382
|
+
</react_native_paper_1.Surface>)}
|
|
346
383
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
384
|
+
{/* Action Buttons */}
|
|
385
|
+
<react_native_1.View style={styles.buttonContainer}>
|
|
386
|
+
<react_native_1.TouchableOpacity style={styles.backButton} onPress={handleBack} disabled={isSubmitting}>
|
|
387
|
+
<react_native_1.Text style={styles.backButtonText}>Back</react_native_1.Text>
|
|
388
|
+
</react_native_1.TouchableOpacity>
|
|
389
|
+
|
|
390
|
+
<react_native_1.TouchableOpacity style={[
|
|
354
391
|
styles.submitButton,
|
|
355
|
-
!formValid && styles.submitButtonDisabled
|
|
356
|
-
]} onPress={handleSubmit} disabled={!formValid}>
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
392
|
+
(!formValid || isSubmitting) && styles.submitButtonDisabled
|
|
393
|
+
]} onPress={handleSubmit} disabled={!formValid || isSubmitting}>
|
|
394
|
+
<expo_linear_gradient_1.LinearGradient colors={formValid && !isSubmitting ? ['#0066CC', '#0099FF'] : ['#9CA3AF', '#9CA3AF']} style={styles.submitGradient} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}>
|
|
395
|
+
{isSubmitting ? (<react_native_1.View style={styles.submittingContent}>
|
|
396
|
+
<react_native_paper_1.ActivityIndicator size="small" color="#FFFFFF"/>
|
|
397
|
+
<react_native_1.Text style={[styles.submitButtonText, styles.submittingText]}>
|
|
398
|
+
Saving...
|
|
399
|
+
</react_native_1.Text>
|
|
400
|
+
</react_native_1.View>) : (<react_native_1.Text style={styles.submitButtonText}>
|
|
401
|
+
{mode === 'test' ? 'Complete Test' : 'Save & Continue'}
|
|
402
|
+
</react_native_1.Text>)}
|
|
403
|
+
</expo_linear_gradient_1.LinearGradient>
|
|
404
|
+
</react_native_1.TouchableOpacity>
|
|
405
|
+
</react_native_1.View>
|
|
406
|
+
</react_native_paper_1.Surface>
|
|
407
|
+
</react_native_1.ScrollView>
|
|
408
|
+
</expo_linear_gradient_1.LinearGradient>
|
|
409
|
+
</react_native_1.View>
|
|
410
|
+
</react_native_1.KeyboardAvoidingView>);
|
|
368
411
|
};
|
|
369
|
-
// Add debug styles
|
|
370
412
|
const styles = react_native_1.StyleSheet.create({
|
|
371
413
|
container: {
|
|
372
414
|
flex: 1,
|
|
@@ -377,6 +419,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
377
419
|
},
|
|
378
420
|
scrollContent: {
|
|
379
421
|
padding: 12,
|
|
422
|
+
paddingBottom: 24,
|
|
380
423
|
},
|
|
381
424
|
headerCard: {
|
|
382
425
|
flexDirection: 'row',
|
|
@@ -505,6 +548,16 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
505
548
|
color: '#4B5563',
|
|
506
549
|
marginRight: 8,
|
|
507
550
|
},
|
|
551
|
+
hintContainer: {
|
|
552
|
+
flexDirection: 'row',
|
|
553
|
+
alignItems: 'center',
|
|
554
|
+
marginTop: 4,
|
|
555
|
+
},
|
|
556
|
+
hintText: {
|
|
557
|
+
fontSize: 10,
|
|
558
|
+
color: '#6B7280',
|
|
559
|
+
marginLeft: 2,
|
|
560
|
+
},
|
|
508
561
|
testModeCard: {
|
|
509
562
|
backgroundColor: '#FEF3C7',
|
|
510
563
|
borderRadius: 10,
|
|
@@ -536,7 +589,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
536
589
|
},
|
|
537
590
|
backButton: {
|
|
538
591
|
flex: 1,
|
|
539
|
-
paddingVertical:
|
|
592
|
+
paddingVertical: 10,
|
|
540
593
|
borderRadius: 10,
|
|
541
594
|
borderWidth: 1,
|
|
542
595
|
borderColor: '#E5E7EB',
|
|
@@ -544,7 +597,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
544
597
|
backgroundColor: '#FFFFFF',
|
|
545
598
|
},
|
|
546
599
|
backButtonText: {
|
|
547
|
-
fontSize:
|
|
600
|
+
fontSize: 13,
|
|
548
601
|
fontWeight: '500',
|
|
549
602
|
color: '#6B7280',
|
|
550
603
|
},
|
|
@@ -557,13 +610,21 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
557
610
|
opacity: 0.5,
|
|
558
611
|
},
|
|
559
612
|
submitGradient: {
|
|
560
|
-
paddingVertical:
|
|
613
|
+
paddingVertical: 10,
|
|
561
614
|
alignItems: 'center',
|
|
562
615
|
},
|
|
563
616
|
submitButtonText: {
|
|
564
|
-
fontSize:
|
|
617
|
+
fontSize: 13,
|
|
565
618
|
fontWeight: '600',
|
|
566
619
|
color: '#FFFFFF',
|
|
567
620
|
},
|
|
621
|
+
submittingContent: {
|
|
622
|
+
flexDirection: 'row',
|
|
623
|
+
alignItems: 'center',
|
|
624
|
+
justifyContent: 'center',
|
|
625
|
+
},
|
|
626
|
+
submittingText: {
|
|
627
|
+
marginLeft: 8,
|
|
628
|
+
},
|
|
568
629
|
});
|
|
569
630
|
exports.default = BankDetails;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Merchant, FormErrors } from '../../types/merchantTypes';
|
|
3
3
|
interface BasicDetailsFormProps {
|
|
4
|
-
initialData: Partial<
|
|
5
|
-
onNext: (data: Partial<
|
|
4
|
+
initialData: Partial<Merchant>;
|
|
5
|
+
onNext: (data: Partial<Merchant>) => void;
|
|
6
6
|
errors: FormErrors;
|
|
7
7
|
setErrors: (errors: FormErrors) => void;
|
|
8
8
|
}
|