@airxpay/sdk-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +400 -0
- package/dist/api/seller.js +17 -0
- package/dist/components/common/CountryDropdown.js +138 -0
- package/dist/components/common/FileUploader.js +210 -0
- package/dist/components/common/StepIndicator.js +269 -0
- package/dist/components/steps/BankDetails.js +562 -0
- package/dist/components/steps/BasicDetailsForm.js +581 -0
- package/dist/components/steps/KYCVerification.js +510 -0
- package/dist/components/steps/OnboardingComplete.js +752 -0
- package/dist/components/ui/SellerOnboard/CustomSegmentedButtons.js +64 -0
- package/dist/components/ui/SellerOnboard/SellerOnboarding.js +490 -0
- package/dist/contexts/AirXPayProvider.js +154 -0
- package/dist/hooks/SellerOnboarding.js +11 -0
- package/dist/index.js +12 -0
- package/dist/sdk/airxpay.js +18 -0
- package/dist/types/sellertypes.js +4 -0
- package/dist/types/type.js +2 -0
- package/package.json +58 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// components/steps/BankDetails.tsx
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const react_native_1 = require("react-native");
|
|
42
|
+
const react_native_paper_1 = require("react-native-paper");
|
|
43
|
+
const expo_linear_gradient_1 = require("expo-linear-gradient");
|
|
44
|
+
const FileUploader_1 = __importDefault(require("../common/FileUploader"));
|
|
45
|
+
const BankDetails = ({ initialData, mode, onNext, onBack, }) => {
|
|
46
|
+
const [formData, setFormData] = (0, react_1.useState)(initialData.bankDetails || {});
|
|
47
|
+
const [cancelledCheque, setCancelledCheque] = (0, react_1.useState)(initialData.bankDetails?.cancelledChequeUrl);
|
|
48
|
+
const [uploading, setUploading] = (0, react_1.useState)(false);
|
|
49
|
+
const [touched, setTouched] = (0, react_1.useState)({});
|
|
50
|
+
const [errors, setErrors] = (0, react_1.useState)({});
|
|
51
|
+
const [showAccountNumber, setShowAccountNumber] = (0, react_1.useState)(false);
|
|
52
|
+
const [formValid, setFormValid] = (0, react_1.useState)(false);
|
|
53
|
+
const validateIFSC = (ifsc) => {
|
|
54
|
+
const ifscRegex = /^[A-Z]{4}0[A-Z0-9]{6}$/;
|
|
55
|
+
return ifscRegex.test(ifsc);
|
|
56
|
+
};
|
|
57
|
+
const validateField = (field, value) => {
|
|
58
|
+
switch (field) {
|
|
59
|
+
case 'accountHolderName':
|
|
60
|
+
if (!value?.trim())
|
|
61
|
+
return 'Account holder name is required';
|
|
62
|
+
if (value.length < 3)
|
|
63
|
+
return 'Name must be at least 3 characters';
|
|
64
|
+
return undefined;
|
|
65
|
+
case 'bankName':
|
|
66
|
+
if (!value?.trim())
|
|
67
|
+
return 'Bank name is required';
|
|
68
|
+
return undefined;
|
|
69
|
+
case 'accountNumber':
|
|
70
|
+
if (!value?.trim())
|
|
71
|
+
return 'Account number is required';
|
|
72
|
+
if (!/^\d{9,18}$/.test(value.replace(/\s/g, ''))) {
|
|
73
|
+
return 'Invalid account number';
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
case 'ifscCode':
|
|
77
|
+
if (!value?.trim())
|
|
78
|
+
return 'IFSC code is required';
|
|
79
|
+
if (!validateIFSC(value.toUpperCase())) {
|
|
80
|
+
return 'Invalid IFSC code';
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
case 'upiId':
|
|
84
|
+
if (value && !/^[\w.-]+@[\w.-]+$/.test(value)) {
|
|
85
|
+
return 'Invalid UPI ID format';
|
|
86
|
+
}
|
|
87
|
+
return undefined;
|
|
88
|
+
default:
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
// Check form validity whenever formData, errors, or cancelledCheque changes
|
|
93
|
+
(0, react_1.useEffect)(() => {
|
|
94
|
+
const requiredFields = [
|
|
95
|
+
'accountHolderName',
|
|
96
|
+
'bankName',
|
|
97
|
+
'accountNumber',
|
|
98
|
+
'ifscCode',
|
|
99
|
+
];
|
|
100
|
+
// Check if all required fields have values
|
|
101
|
+
const allRequiredFilled = requiredFields.every(field => {
|
|
102
|
+
const value = formData[field];
|
|
103
|
+
return value && value.trim().length > 0;
|
|
104
|
+
});
|
|
105
|
+
// Check if there are any errors
|
|
106
|
+
const hasNoErrors = Object.keys(errors).length === 0;
|
|
107
|
+
// Check if cheque is uploaded
|
|
108
|
+
const hasCheque = cancelledCheque !== undefined && cancelledCheque !== '';
|
|
109
|
+
// Validate each field individually for debugging
|
|
110
|
+
const fieldValues = {
|
|
111
|
+
accountHolderName: formData.accountHolderName || 'empty',
|
|
112
|
+
bankName: formData.bankName || 'empty',
|
|
113
|
+
accountNumber: formData.accountNumber || 'empty',
|
|
114
|
+
ifscCode: formData.ifscCode || 'empty',
|
|
115
|
+
cheque: cancelledCheque || 'empty'
|
|
116
|
+
};
|
|
117
|
+
const fieldErrors = { ...errors };
|
|
118
|
+
const isValid = allRequiredFilled && hasNoErrors && hasCheque;
|
|
119
|
+
setFormValid(isValid);
|
|
120
|
+
// Debug log
|
|
121
|
+
console.log('=== Form Validation Debug ===');
|
|
122
|
+
console.log('Field Values:', fieldValues);
|
|
123
|
+
console.log('Field Errors:', fieldErrors);
|
|
124
|
+
console.log('allRequiredFilled:', allRequiredFilled);
|
|
125
|
+
console.log('hasNoErrors:', hasNoErrors);
|
|
126
|
+
console.log('hasCheque:', hasCheque);
|
|
127
|
+
console.log('Form Valid:', isValid);
|
|
128
|
+
console.log('============================');
|
|
129
|
+
}, [formData, errors, cancelledCheque]);
|
|
130
|
+
const handleChange = (field, value) => {
|
|
131
|
+
if (field === 'ifscCode') {
|
|
132
|
+
value = value.toUpperCase();
|
|
133
|
+
}
|
|
134
|
+
setFormData(prev => ({ ...prev, [field]: value }));
|
|
135
|
+
// Validate on change
|
|
136
|
+
const error = validateField(field, value);
|
|
137
|
+
setErrors(prev => {
|
|
138
|
+
const newErrors = { ...prev };
|
|
139
|
+
if (error) {
|
|
140
|
+
newErrors[field] = error;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
delete newErrors[field];
|
|
144
|
+
}
|
|
145
|
+
return newErrors;
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
const handleBlur = (field) => {
|
|
149
|
+
setTouched(prev => ({ ...prev, [field]: true }));
|
|
150
|
+
const value = formData[field];
|
|
151
|
+
const error = validateField(field, value);
|
|
152
|
+
setErrors(prev => {
|
|
153
|
+
const newErrors = { ...prev };
|
|
154
|
+
if (error) {
|
|
155
|
+
newErrors[field] = error;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
delete newErrors[field];
|
|
159
|
+
}
|
|
160
|
+
return newErrors;
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
const handleChequeUpload = async (file) => {
|
|
164
|
+
setUploading(true);
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
setCancelledCheque(file.uri || 'uploaded_cheque.jpg');
|
|
167
|
+
setUploading(false);
|
|
168
|
+
}, 1000);
|
|
169
|
+
};
|
|
170
|
+
const handleChequeRemove = () => {
|
|
171
|
+
react_native_1.Alert.alert('Remove Document', 'Are you sure you want to remove the cancelled cheque?', [
|
|
172
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
173
|
+
{
|
|
174
|
+
text: 'Remove',
|
|
175
|
+
style: 'destructive',
|
|
176
|
+
onPress: () => setCancelledCheque(undefined),
|
|
177
|
+
},
|
|
178
|
+
]);
|
|
179
|
+
};
|
|
180
|
+
const handleSubmit = () => {
|
|
181
|
+
// Final validation before submit
|
|
182
|
+
const requiredFields = [
|
|
183
|
+
'accountHolderName',
|
|
184
|
+
'bankName',
|
|
185
|
+
'accountNumber',
|
|
186
|
+
'ifscCode',
|
|
187
|
+
];
|
|
188
|
+
const newErrors = {};
|
|
189
|
+
requiredFields.forEach(field => {
|
|
190
|
+
const error = validateField(field, formData[field]);
|
|
191
|
+
if (error)
|
|
192
|
+
newErrors[field] = error;
|
|
193
|
+
});
|
|
194
|
+
if (Object.keys(newErrors).length > 0) {
|
|
195
|
+
setErrors(newErrors);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (!cancelledCheque) {
|
|
199
|
+
react_native_1.Alert.alert('Error', 'Please upload cancelled cheque');
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
onNext({
|
|
203
|
+
bankDetails: {
|
|
204
|
+
...formData,
|
|
205
|
+
cancelledChequeUrl: cancelledCheque,
|
|
206
|
+
},
|
|
207
|
+
isBankDetailsCompleted: true,
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
const maskAccountNumber = (value) => {
|
|
211
|
+
const cleaned = value.replace(/\s/g, '');
|
|
212
|
+
if (cleaned.length <= 4)
|
|
213
|
+
return cleaned;
|
|
214
|
+
const last4 = cleaned.slice(-4);
|
|
215
|
+
const masked = '•'.repeat(Math.min(cleaned.length - 4, 8));
|
|
216
|
+
return masked + last4;
|
|
217
|
+
};
|
|
218
|
+
return (<react_native_1.View style={styles.container}>
|
|
219
|
+
<expo_linear_gradient_1.LinearGradient colors={['#FFFFFF', '#F8F9FA']} style={styles.gradient}>
|
|
220
|
+
<react_native_1.ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent}>
|
|
221
|
+
{/* Header Card */}
|
|
222
|
+
<react_native_paper_1.Surface style={styles.headerCard}>
|
|
223
|
+
<react_native_1.View style={styles.headerIcon}>
|
|
224
|
+
<react_native_paper_1.IconButton icon="bank" size={24} iconColor="#0066CC"/>
|
|
225
|
+
</react_native_1.View>
|
|
226
|
+
<react_native_1.View style={styles.headerText}>
|
|
227
|
+
<react_native_1.Text style={styles.title}>Bank Details</react_native_1.Text>
|
|
228
|
+
<react_native_1.Text style={styles.subtitle}>
|
|
229
|
+
Add your bank account for settlements
|
|
230
|
+
</react_native_1.Text>
|
|
231
|
+
</react_native_1.View>
|
|
232
|
+
</react_native_paper_1.Surface>
|
|
233
|
+
|
|
234
|
+
{/* Form Card */}
|
|
235
|
+
<react_native_paper_1.Surface style={styles.formCard}>
|
|
236
|
+
{/* Progress Steps */}
|
|
237
|
+
<react_native_1.View style={styles.progressContainer}>
|
|
238
|
+
<react_native_1.View style={styles.progressStep}>
|
|
239
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotCompleted]}>
|
|
240
|
+
<react_native_paper_1.IconButton icon="check" size={12} iconColor="#FFFFFF"/>
|
|
241
|
+
</react_native_1.View>
|
|
242
|
+
<react_native_1.Text style={styles.progressTextCompleted}>Basic</react_native_1.Text>
|
|
243
|
+
</react_native_1.View>
|
|
244
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
245
|
+
<react_native_1.View style={styles.progressStep}>
|
|
246
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotCompleted]}>
|
|
247
|
+
<react_native_paper_1.IconButton icon="check" size={12} iconColor="#FFFFFF"/>
|
|
248
|
+
</react_native_1.View>
|
|
249
|
+
<react_native_1.Text style={styles.progressTextCompleted}>KYC</react_native_1.Text>
|
|
250
|
+
</react_native_1.View>
|
|
251
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
252
|
+
<react_native_1.View style={styles.progressStep}>
|
|
253
|
+
<expo_linear_gradient_1.LinearGradient colors={['#0066CC', '#0099FF']} style={styles.progressDotActive}/>
|
|
254
|
+
<react_native_1.Text style={styles.progressTextActive}>Bank</react_native_1.Text>
|
|
255
|
+
</react_native_1.View>
|
|
256
|
+
</react_native_1.View>
|
|
257
|
+
|
|
258
|
+
{/* Account Holder Name */}
|
|
259
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
260
|
+
<react_native_1.Text style={styles.label}>
|
|
261
|
+
Account Holder Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
262
|
+
</react_native_1.Text>
|
|
263
|
+
<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"/>
|
|
264
|
+
{errors.accountHolderName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
265
|
+
{errors.accountHolderName}
|
|
266
|
+
</react_native_paper_1.HelperText>)}
|
|
267
|
+
</react_native_1.View>
|
|
268
|
+
|
|
269
|
+
{/* Bank Name */}
|
|
270
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
271
|
+
<react_native_1.Text style={styles.label}>
|
|
272
|
+
Bank Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
273
|
+
</react_native_1.Text>
|
|
274
|
+
<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"/>
|
|
275
|
+
{errors.bankName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
276
|
+
{errors.bankName}
|
|
277
|
+
</react_native_paper_1.HelperText>)}
|
|
278
|
+
</react_native_1.View>
|
|
279
|
+
|
|
280
|
+
{/* Account Number */}
|
|
281
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
282
|
+
<react_native_1.Text style={styles.label}>
|
|
283
|
+
Account Number <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
284
|
+
</react_native_1.Text>
|
|
285
|
+
<react_native_1.View>
|
|
286
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.accountNumber} onChangeText={(text) => handleChange('accountNumber', text.replace(/\D/g, ''))} 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}/>
|
|
287
|
+
</react_native_1.View>
|
|
288
|
+
{errors.accountNumber && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
289
|
+
{errors.accountNumber}
|
|
290
|
+
</react_native_paper_1.HelperText>)}
|
|
291
|
+
{formData.accountNumber && !errors.accountNumber && (<react_native_1.View style={styles.previewContainer}>
|
|
292
|
+
<react_native_paper_1.IconButton icon="eye" size={14} iconColor="#6B7280"/>
|
|
293
|
+
<react_native_1.Text style={styles.previewText}>
|
|
294
|
+
{maskAccountNumber(formData.accountNumber)}
|
|
295
|
+
</react_native_1.Text>
|
|
296
|
+
</react_native_1.View>)}
|
|
297
|
+
</react_native_1.View>
|
|
298
|
+
|
|
299
|
+
{/* IFSC Code */}
|
|
300
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
301
|
+
<react_native_1.Text style={styles.label}>
|
|
302
|
+
IFSC Code <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
303
|
+
</react_native_1.Text>
|
|
304
|
+
<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}/>
|
|
305
|
+
{errors.ifscCode && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
306
|
+
{errors.ifscCode}
|
|
307
|
+
</react_native_paper_1.HelperText>)}
|
|
308
|
+
</react_native_1.View>
|
|
309
|
+
|
|
310
|
+
{/* UPI ID */}
|
|
311
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
312
|
+
<react_native_1.Text style={styles.label}>UPI ID (Optional)</react_native_1.Text>
|
|
313
|
+
<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"/>
|
|
314
|
+
{errors.upiId && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
315
|
+
{errors.upiId}
|
|
316
|
+
</react_native_paper_1.HelperText>)}
|
|
317
|
+
</react_native_1.View>
|
|
318
|
+
|
|
319
|
+
{/* Cancelled Cheque Upload */}
|
|
320
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
321
|
+
<react_native_1.Text style={styles.label}>
|
|
322
|
+
Cancelled Cheque <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
323
|
+
</react_native_1.Text>
|
|
324
|
+
<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/*"/>
|
|
325
|
+
</react_native_1.View>
|
|
326
|
+
|
|
327
|
+
{/* Test Mode Notice */}
|
|
328
|
+
{mode === 'test' && (<react_native_paper_1.Surface style={styles.testModeCard}>
|
|
329
|
+
<react_native_1.View style={styles.testModeContent}>
|
|
330
|
+
<react_native_paper_1.IconButton icon="flask" size={16} iconColor="#92400E"/>
|
|
331
|
+
<react_native_1.View style={styles.testModeText}>
|
|
332
|
+
<react_native_1.Text style={styles.testModeTitle}>Test Mode Active</react_native_1.Text>
|
|
333
|
+
<react_native_1.Text style={styles.testModeDescription}>
|
|
334
|
+
Bank details are for testing only
|
|
335
|
+
</react_native_1.Text>
|
|
336
|
+
</react_native_1.View>
|
|
337
|
+
</react_native_1.View>
|
|
338
|
+
</react_native_paper_1.Surface>)}
|
|
339
|
+
|
|
340
|
+
{/* Action Buttons */}
|
|
341
|
+
<react_native_1.View style={styles.buttonContainer}>
|
|
342
|
+
<react_native_1.TouchableOpacity style={styles.backButton} onPress={onBack}>
|
|
343
|
+
<react_native_1.Text style={styles.backButtonText}>Back</react_native_1.Text>
|
|
344
|
+
</react_native_1.TouchableOpacity>
|
|
345
|
+
|
|
346
|
+
<react_native_1.TouchableOpacity style={[
|
|
347
|
+
styles.submitButton,
|
|
348
|
+
!formValid && styles.submitButtonDisabled
|
|
349
|
+
]} onPress={handleSubmit} disabled={!formValid}>
|
|
350
|
+
<expo_linear_gradient_1.LinearGradient colors={formValid ? ['#0066CC', '#0099FF'] : ['#9CA3AF', '#9CA3AF']} style={styles.submitGradient} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}>
|
|
351
|
+
<react_native_1.Text style={styles.submitButtonText}>
|
|
352
|
+
{mode === 'test' ? 'Complete Test' : 'Save & Continue'}
|
|
353
|
+
</react_native_1.Text>
|
|
354
|
+
</expo_linear_gradient_1.LinearGradient>
|
|
355
|
+
</react_native_1.TouchableOpacity>
|
|
356
|
+
</react_native_1.View>
|
|
357
|
+
</react_native_paper_1.Surface>
|
|
358
|
+
</react_native_1.ScrollView>
|
|
359
|
+
</expo_linear_gradient_1.LinearGradient>
|
|
360
|
+
</react_native_1.View>);
|
|
361
|
+
};
|
|
362
|
+
// Add debug styles
|
|
363
|
+
const styles = react_native_1.StyleSheet.create({
|
|
364
|
+
container: {
|
|
365
|
+
flex: 1,
|
|
366
|
+
backgroundColor: '#FFFFFF',
|
|
367
|
+
},
|
|
368
|
+
gradient: {
|
|
369
|
+
flex: 1,
|
|
370
|
+
},
|
|
371
|
+
scrollContent: {
|
|
372
|
+
padding: 12,
|
|
373
|
+
},
|
|
374
|
+
headerCard: {
|
|
375
|
+
flexDirection: 'row',
|
|
376
|
+
alignItems: 'center',
|
|
377
|
+
padding: 12,
|
|
378
|
+
backgroundColor: '#FFFFFF',
|
|
379
|
+
borderRadius: 16,
|
|
380
|
+
marginBottom: 12,
|
|
381
|
+
elevation: 2,
|
|
382
|
+
shadowColor: '#000',
|
|
383
|
+
shadowOffset: { width: 0, height: 2 },
|
|
384
|
+
shadowOpacity: 0.1,
|
|
385
|
+
shadowRadius: 4,
|
|
386
|
+
},
|
|
387
|
+
headerIcon: {
|
|
388
|
+
width: 40,
|
|
389
|
+
height: 40,
|
|
390
|
+
borderRadius: 20,
|
|
391
|
+
backgroundColor: '#F0F7FF',
|
|
392
|
+
justifyContent: 'center',
|
|
393
|
+
alignItems: 'center',
|
|
394
|
+
marginRight: 12,
|
|
395
|
+
},
|
|
396
|
+
headerText: {
|
|
397
|
+
flex: 1,
|
|
398
|
+
},
|
|
399
|
+
title: {
|
|
400
|
+
fontSize: 18,
|
|
401
|
+
fontWeight: '700',
|
|
402
|
+
color: '#111827',
|
|
403
|
+
},
|
|
404
|
+
subtitle: {
|
|
405
|
+
fontSize: 12,
|
|
406
|
+
color: '#6B7280',
|
|
407
|
+
marginTop: 2,
|
|
408
|
+
},
|
|
409
|
+
formCard: {
|
|
410
|
+
backgroundColor: '#FFFFFF',
|
|
411
|
+
borderRadius: 20,
|
|
412
|
+
padding: 16,
|
|
413
|
+
elevation: 2,
|
|
414
|
+
shadowColor: '#000',
|
|
415
|
+
shadowOffset: { width: 0, height: 2 },
|
|
416
|
+
shadowOpacity: 0.1,
|
|
417
|
+
shadowRadius: 4,
|
|
418
|
+
},
|
|
419
|
+
progressContainer: {
|
|
420
|
+
flexDirection: 'row',
|
|
421
|
+
alignItems: 'center',
|
|
422
|
+
justifyContent: 'center',
|
|
423
|
+
marginBottom: 20,
|
|
424
|
+
paddingHorizontal: 8,
|
|
425
|
+
},
|
|
426
|
+
progressStep: {
|
|
427
|
+
alignItems: 'center',
|
|
428
|
+
},
|
|
429
|
+
progressDot: {
|
|
430
|
+
width: 24,
|
|
431
|
+
height: 24,
|
|
432
|
+
borderRadius: 12,
|
|
433
|
+
justifyContent: 'center',
|
|
434
|
+
alignItems: 'center',
|
|
435
|
+
},
|
|
436
|
+
progressDotCompleted: {
|
|
437
|
+
backgroundColor: '#10B981',
|
|
438
|
+
},
|
|
439
|
+
progressDotActive: {
|
|
440
|
+
width: 24,
|
|
441
|
+
height: 24,
|
|
442
|
+
borderRadius: 12,
|
|
443
|
+
},
|
|
444
|
+
progressLine: {
|
|
445
|
+
width: 30,
|
|
446
|
+
height: 2,
|
|
447
|
+
backgroundColor: '#E5E7EB',
|
|
448
|
+
marginHorizontal: 4,
|
|
449
|
+
},
|
|
450
|
+
progressTextCompleted: {
|
|
451
|
+
fontSize: 9,
|
|
452
|
+
color: '#10B981',
|
|
453
|
+
marginTop: 4,
|
|
454
|
+
fontWeight: '500',
|
|
455
|
+
},
|
|
456
|
+
progressTextActive: {
|
|
457
|
+
fontSize: 9,
|
|
458
|
+
color: '#0066CC',
|
|
459
|
+
marginTop: 4,
|
|
460
|
+
fontWeight: '600',
|
|
461
|
+
},
|
|
462
|
+
fieldContainer: {
|
|
463
|
+
marginBottom: 14,
|
|
464
|
+
},
|
|
465
|
+
label: {
|
|
466
|
+
fontSize: 12,
|
|
467
|
+
fontWeight: '500',
|
|
468
|
+
color: '#374151',
|
|
469
|
+
marginBottom: 4,
|
|
470
|
+
},
|
|
471
|
+
requiredStar: {
|
|
472
|
+
color: '#EF4444',
|
|
473
|
+
},
|
|
474
|
+
input: {
|
|
475
|
+
backgroundColor: '#FFFFFF',
|
|
476
|
+
fontSize: 13,
|
|
477
|
+
height: 44,
|
|
478
|
+
},
|
|
479
|
+
inputWithRightIcon: {
|
|
480
|
+
paddingRight: 40,
|
|
481
|
+
},
|
|
482
|
+
errorText: {
|
|
483
|
+
fontSize: 10,
|
|
484
|
+
color: '#EF4444',
|
|
485
|
+
marginTop: 2,
|
|
486
|
+
},
|
|
487
|
+
previewContainer: {
|
|
488
|
+
flexDirection: 'row',
|
|
489
|
+
alignItems: 'center',
|
|
490
|
+
marginTop: 4,
|
|
491
|
+
backgroundColor: '#F3F4F6',
|
|
492
|
+
borderRadius: 6,
|
|
493
|
+
paddingHorizontal: 4,
|
|
494
|
+
alignSelf: 'flex-start',
|
|
495
|
+
},
|
|
496
|
+
previewText: {
|
|
497
|
+
fontSize: 11,
|
|
498
|
+
color: '#4B5563',
|
|
499
|
+
marginRight: 8,
|
|
500
|
+
},
|
|
501
|
+
testModeCard: {
|
|
502
|
+
backgroundColor: '#FEF3C7',
|
|
503
|
+
borderRadius: 10,
|
|
504
|
+
marginVertical: 8,
|
|
505
|
+
overflow: 'hidden',
|
|
506
|
+
},
|
|
507
|
+
testModeContent: {
|
|
508
|
+
flexDirection: 'row',
|
|
509
|
+
alignItems: 'center',
|
|
510
|
+
padding: 8,
|
|
511
|
+
},
|
|
512
|
+
testModeText: {
|
|
513
|
+
flex: 1,
|
|
514
|
+
},
|
|
515
|
+
testModeTitle: {
|
|
516
|
+
fontSize: 12,
|
|
517
|
+
fontWeight: '600',
|
|
518
|
+
color: '#92400E',
|
|
519
|
+
},
|
|
520
|
+
testModeDescription: {
|
|
521
|
+
fontSize: 11,
|
|
522
|
+
color: '#92400E',
|
|
523
|
+
marginTop: 1,
|
|
524
|
+
},
|
|
525
|
+
buttonContainer: {
|
|
526
|
+
flexDirection: 'row',
|
|
527
|
+
gap: 8,
|
|
528
|
+
marginTop: 16,
|
|
529
|
+
},
|
|
530
|
+
backButton: {
|
|
531
|
+
flex: 1,
|
|
532
|
+
paddingVertical: 8,
|
|
533
|
+
borderRadius: 10,
|
|
534
|
+
borderWidth: 1,
|
|
535
|
+
borderColor: '#E5E7EB',
|
|
536
|
+
alignItems: 'center',
|
|
537
|
+
backgroundColor: '#FFFFFF',
|
|
538
|
+
},
|
|
539
|
+
backButtonText: {
|
|
540
|
+
fontSize: 12,
|
|
541
|
+
fontWeight: '500',
|
|
542
|
+
color: '#6B7280',
|
|
543
|
+
},
|
|
544
|
+
submitButton: {
|
|
545
|
+
flex: 2,
|
|
546
|
+
borderRadius: 10,
|
|
547
|
+
overflow: 'hidden',
|
|
548
|
+
},
|
|
549
|
+
submitButtonDisabled: {
|
|
550
|
+
opacity: 0.5,
|
|
551
|
+
},
|
|
552
|
+
submitGradient: {
|
|
553
|
+
paddingVertical: 8,
|
|
554
|
+
alignItems: 'center',
|
|
555
|
+
},
|
|
556
|
+
submitButtonText: {
|
|
557
|
+
fontSize: 12,
|
|
558
|
+
fontWeight: '600',
|
|
559
|
+
color: '#FFFFFF',
|
|
560
|
+
},
|
|
561
|
+
});
|
|
562
|
+
exports.default = BankDetails;
|