@airxpay/sdk-ui 1.0.5 → 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} +121 -56
- package/dist/contexts/AirXPayProvider.d.ts +10 -10
- package/dist/contexts/AirXPayProvider.js +24 -92
- 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
|
@@ -48,7 +48,7 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
48
48
|
const fadeAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
49
49
|
const slideAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(50)).current;
|
|
50
50
|
const scaleAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0.95)).current;
|
|
51
|
-
const [formData, setFormData] = (0, react_1.useState)(Object.assign({
|
|
51
|
+
const [formData, setFormData] = (0, react_1.useState)(Object.assign({ merchantName: '', merchantEmail: '', merchantPhone: '', businessName: '', businessType: 'individual', businessCategory: '', country: 'India', nationality: 'Indian', dob: '' }, initialData));
|
|
52
52
|
const [showDatePicker, setShowDatePicker] = (0, react_1.useState)(false);
|
|
53
53
|
const [touched, setTouched] = (0, react_1.useState)({});
|
|
54
54
|
const [focusedField, setFocusedField] = (0, react_1.useState)(null);
|
|
@@ -76,22 +76,25 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
76
76
|
}, []);
|
|
77
77
|
const validateField = (field, value) => {
|
|
78
78
|
switch (field) {
|
|
79
|
-
case '
|
|
79
|
+
case 'merchantName':
|
|
80
80
|
if (!(value === null || value === void 0 ? void 0 : value.trim()))
|
|
81
|
-
return '
|
|
81
|
+
return 'Merchant name is required';
|
|
82
82
|
if (value.length < 2)
|
|
83
83
|
return 'Name must be at least 2 characters';
|
|
84
84
|
if (value.length > 50)
|
|
85
85
|
return 'Name must be less than 50 characters';
|
|
86
|
+
if (!/^[a-zA-Z\s'-]+$/.test(value))
|
|
87
|
+
return 'Name contains invalid characters';
|
|
86
88
|
return undefined;
|
|
87
|
-
case '
|
|
89
|
+
case 'merchantEmail':
|
|
88
90
|
if (!(value === null || value === void 0 ? void 0 : value.trim()))
|
|
89
91
|
return 'Email is required';
|
|
90
|
-
|
|
92
|
+
// More comprehensive email regex
|
|
93
|
+
const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
91
94
|
if (!emailRegex.test(value))
|
|
92
95
|
return 'Invalid email format';
|
|
93
96
|
return undefined;
|
|
94
|
-
case '
|
|
97
|
+
case 'merchantPhone':
|
|
95
98
|
if (value && !/^\d{10}$/.test(value.replace(/\D/g, ''))) {
|
|
96
99
|
return 'Phone must be 10 digits';
|
|
97
100
|
}
|
|
@@ -106,6 +109,10 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
106
109
|
}
|
|
107
110
|
};
|
|
108
111
|
const handleChange = (field, value) => {
|
|
112
|
+
// Format phone number
|
|
113
|
+
if (field === 'merchantPhone') {
|
|
114
|
+
value = value.replace(/\D/g, '');
|
|
115
|
+
}
|
|
109
116
|
setFormData(prev => (Object.assign(Object.assign({}, prev), { [field]: value })));
|
|
110
117
|
// Validate on change
|
|
111
118
|
const error = validateField(field, value);
|
|
@@ -145,7 +152,7 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
145
152
|
};
|
|
146
153
|
const validateForm = () => {
|
|
147
154
|
const newErrors = {};
|
|
148
|
-
const requiredFields = ['
|
|
155
|
+
const requiredFields = ['merchantName', 'merchantEmail'];
|
|
149
156
|
if (formData.businessType === 'company') {
|
|
150
157
|
requiredFields.push('businessName');
|
|
151
158
|
}
|
|
@@ -179,7 +186,7 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
179
186
|
}
|
|
180
187
|
};
|
|
181
188
|
const isFormValid = () => {
|
|
182
|
-
const requiredFields = ['
|
|
189
|
+
const requiredFields = ['merchantName', 'merchantEmail'];
|
|
183
190
|
if (formData.businessType === 'company') {
|
|
184
191
|
requiredFields.push('businessName');
|
|
185
192
|
}
|
|
@@ -190,17 +197,6 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
190
197
|
});
|
|
191
198
|
// Check if there are any errors
|
|
192
199
|
const hasNoErrors = Object.keys(localErrors).length === 0;
|
|
193
|
-
console.log('Form Valid Check:', {
|
|
194
|
-
allRequiredFilled,
|
|
195
|
-
hasNoErrors,
|
|
196
|
-
localErrors,
|
|
197
|
-
formData: {
|
|
198
|
-
sellerName: formData.sellerName,
|
|
199
|
-
sellerEmail: formData.sellerEmail,
|
|
200
|
-
businessName: formData.businessName,
|
|
201
|
-
businessType: formData.businessType
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
200
|
return allRequiredFilled && hasNoErrors;
|
|
205
201
|
};
|
|
206
202
|
const businessCategories = [
|
|
@@ -215,7 +211,8 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
215
211
|
'Food',
|
|
216
212
|
'Other',
|
|
217
213
|
];
|
|
218
|
-
return (<react_native_1.
|
|
214
|
+
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}>
|
|
215
|
+
<react_native_1.Animated.View style={[
|
|
219
216
|
styles.container,
|
|
220
217
|
{
|
|
221
218
|
opacity: fadeAnim,
|
|
@@ -225,166 +222,167 @@ const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
|
225
222
|
]
|
|
226
223
|
}
|
|
227
224
|
]}>
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
</react_native_1.View>
|
|
235
|
-
<react_native_1.View style={styles.headerText}>
|
|
236
|
-
<react_native_paper_1.Title style={styles.title}>Basic Information</react_native_paper_1.Title>
|
|
237
|
-
<react_native_1.Text style={styles.subtitle}>
|
|
238
|
-
Tell us about yourself
|
|
239
|
-
</react_native_1.Text>
|
|
240
|
-
</react_native_1.View>
|
|
241
|
-
</react_native_paper_1.Surface>
|
|
242
|
-
|
|
243
|
-
{/* Form Card */}
|
|
244
|
-
<react_native_paper_1.Surface style={styles.formCard}>
|
|
245
|
-
{/* Compact Progress Steps */}
|
|
246
|
-
<react_native_1.View style={styles.progressContainer}>
|
|
247
|
-
<react_native_1.View style={styles.progressStep}>
|
|
248
|
-
<expo_linear_gradient_1.LinearGradient colors={['#0066CC', '#0099FF']} style={styles.progressDot}/>
|
|
249
|
-
<react_native_1.Text style={styles.progressTextActive}>Basic</react_native_1.Text>
|
|
225
|
+
<expo_linear_gradient_1.LinearGradient colors={['#FFFFFF', '#F8F9FA']} style={styles.gradient}>
|
|
226
|
+
<react_native_1.ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent} keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">
|
|
227
|
+
{/* Header Card */}
|
|
228
|
+
<react_native_paper_1.Surface style={styles.headerCard}>
|
|
229
|
+
<react_native_1.View style={styles.headerIcon}>
|
|
230
|
+
<react_native_paper_1.IconButton icon="account-details" size={28} iconColor="#0066CC"/>
|
|
250
231
|
</react_native_1.View>
|
|
251
|
-
<react_native_1.View style={styles.
|
|
252
|
-
|
|
253
|
-
<react_native_1.
|
|
254
|
-
|
|
232
|
+
<react_native_1.View style={styles.headerText}>
|
|
233
|
+
<react_native_paper_1.Title style={styles.title}>Basic Information</react_native_paper_1.Title>
|
|
234
|
+
<react_native_1.Text style={styles.subtitle}>
|
|
235
|
+
Tell us about yourself
|
|
236
|
+
</react_native_1.Text>
|
|
255
237
|
</react_native_1.View>
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
238
|
+
</react_native_paper_1.Surface>
|
|
239
|
+
|
|
240
|
+
{/* Form Card */}
|
|
241
|
+
<react_native_paper_1.Surface style={styles.formCard}>
|
|
242
|
+
{/* Compact Progress Steps */}
|
|
243
|
+
<react_native_1.View style={styles.progressContainer}>
|
|
244
|
+
<react_native_1.View style={styles.progressStep}>
|
|
245
|
+
<expo_linear_gradient_1.LinearGradient colors={['#0066CC', '#0099FF']} style={styles.progressDot}/>
|
|
246
|
+
<react_native_1.Text style={styles.progressTextActive}>Basic</react_native_1.Text>
|
|
247
|
+
</react_native_1.View>
|
|
248
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
249
|
+
<react_native_1.View style={styles.progressStep}>
|
|
250
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotInactive]}/>
|
|
251
|
+
<react_native_1.Text style={styles.progressText}>KYC</react_native_1.Text>
|
|
252
|
+
</react_native_1.View>
|
|
253
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
254
|
+
<react_native_1.View style={styles.progressStep}>
|
|
255
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotInactive]}/>
|
|
256
|
+
<react_native_1.Text style={styles.progressText}>Bank</react_native_1.Text>
|
|
257
|
+
</react_native_1.View>
|
|
260
258
|
</react_native_1.View>
|
|
261
|
-
</react_native_1.View>
|
|
262
259
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
260
|
+
{/* Merchant Name */}
|
|
261
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
262
|
+
<react_native_1.Text style={styles.label}>
|
|
263
|
+
Full Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
264
|
+
</react_native_1.Text>
|
|
265
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.merchantName} onChangeText={(text) => handleChange('merchantName', text)} onBlur={() => handleBlur('merchantName')} onFocus={() => handleFocus('merchantName')} error={!!localErrors.merchantName || !!errors.merchantName} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="account" color="#6B7280"/>} placeholder="John Doe" placeholderTextColor="#9CA3AF"/>
|
|
266
|
+
{(localErrors.merchantName || errors.merchantName) && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
267
|
+
{localErrors.merchantName || errors.merchantName}
|
|
268
|
+
</react_native_paper_1.HelperText>)}
|
|
269
|
+
</react_native_1.View>
|
|
273
270
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
271
|
+
{/* Email */}
|
|
272
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
273
|
+
<react_native_1.Text style={styles.label}>
|
|
274
|
+
Email <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
275
|
+
</react_native_1.Text>
|
|
276
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.merchantEmail} onChangeText={(text) => handleChange('merchantEmail', text)} onBlur={() => handleBlur('merchantEmail')} onFocus={() => handleFocus('merchantEmail')} keyboardType="email-address" autoCapitalize="none" error={!!localErrors.merchantEmail || !!errors.merchantEmail} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="email" color="#6B7280"/>} placeholder="john@example.com" placeholderTextColor="#9CA3AF"/>
|
|
277
|
+
{(localErrors.merchantEmail || errors.merchantEmail) && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
278
|
+
{localErrors.merchantEmail || errors.merchantEmail}
|
|
279
|
+
</react_native_paper_1.HelperText>)}
|
|
280
|
+
</react_native_1.View>
|
|
284
281
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
282
|
+
{/* Phone */}
|
|
283
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
284
|
+
<react_native_1.Text style={styles.label}>Phone Number</react_native_1.Text>
|
|
285
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.merchantPhone} onChangeText={(text) => handleChange('merchantPhone', text)} onBlur={() => handleBlur('merchantPhone')} onFocus={() => handleFocus('merchantPhone')} keyboardType="phone-pad" error={!!localErrors.merchantPhone} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="phone" color="#6B7280"/>} placeholder="9876543210" placeholderTextColor="#9CA3AF" maxLength={10}/>
|
|
286
|
+
{localErrors.merchantPhone && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
287
|
+
{localErrors.merchantPhone}
|
|
288
|
+
</react_native_paper_1.HelperText>)}
|
|
289
|
+
</react_native_1.View>
|
|
293
290
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
291
|
+
{/* Business Type */}
|
|
292
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
293
|
+
<react_native_1.Text style={styles.label}>
|
|
294
|
+
Business Type <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
295
|
+
</react_native_1.Text>
|
|
296
|
+
<react_native_1.View style={styles.businessTypeContainer}>
|
|
297
|
+
<react_native_1.TouchableOpacity style={[
|
|
301
298
|
styles.businessTypeButton,
|
|
302
299
|
formData.businessType === 'individual' && styles.businessTypeButtonActive
|
|
303
300
|
]} onPress={() => handleChange('businessType', 'individual')}>
|
|
304
|
-
|
|
305
|
-
|
|
301
|
+
<react_native_paper_1.IconButton icon="account" size={20} iconColor={formData.businessType === 'individual' ? '#0066CC' : '#6B7280'}/>
|
|
302
|
+
<react_native_1.Text style={[
|
|
306
303
|
styles.businessTypeText,
|
|
307
304
|
formData.businessType === 'individual' && styles.businessTypeTextActive
|
|
308
305
|
]}>
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
306
|
+
Individual
|
|
307
|
+
</react_native_1.Text>
|
|
308
|
+
</react_native_1.TouchableOpacity>
|
|
312
309
|
|
|
313
|
-
|
|
310
|
+
<react_native_1.TouchableOpacity style={[
|
|
314
311
|
styles.businessTypeButton,
|
|
315
312
|
formData.businessType === 'company' && styles.businessTypeButtonActive
|
|
316
313
|
]} onPress={() => handleChange('businessType', 'company')}>
|
|
317
|
-
|
|
318
|
-
|
|
314
|
+
<react_native_paper_1.IconButton icon="office-building" size={20} iconColor={formData.businessType === 'company' ? '#0066CC' : '#6B7280'}/>
|
|
315
|
+
<react_native_1.Text style={[
|
|
319
316
|
styles.businessTypeText,
|
|
320
317
|
formData.businessType === 'company' && styles.businessTypeTextActive
|
|
321
318
|
]}>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
319
|
+
Company
|
|
320
|
+
</react_native_1.Text>
|
|
321
|
+
</react_native_1.TouchableOpacity>
|
|
322
|
+
</react_native_1.View>
|
|
325
323
|
</react_native_1.View>
|
|
326
|
-
</react_native_1.View>
|
|
327
324
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
325
|
+
{/* Business Name - Show only for company */}
|
|
326
|
+
{formData.businessType === 'company' && (<react_native_1.View style={styles.fieldContainer}>
|
|
327
|
+
<react_native_1.Text style={styles.label}>
|
|
328
|
+
Business Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
329
|
+
</react_native_1.Text>
|
|
330
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.businessName} onChangeText={(text) => handleChange('businessName', text)} onBlur={() => handleBlur('businessName')} onFocus={() => handleFocus('businessName')} error={!!localErrors.businessName} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="store" color="#6B7280"/>} placeholder="Your Company Name" placeholderTextColor="#9CA3AF"/>
|
|
331
|
+
{localErrors.businessName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
332
|
+
{localErrors.businessName}
|
|
333
|
+
</react_native_paper_1.HelperText>)}
|
|
334
|
+
</react_native_1.View>)}
|
|
338
335
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
336
|
+
{/* Business Category */}
|
|
337
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
338
|
+
<react_native_1.Text style={styles.label}>Category</react_native_1.Text>
|
|
339
|
+
<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.categoryScroll}>
|
|
340
|
+
<react_native_1.View style={styles.categoryContainer}>
|
|
341
|
+
{businessCategories.map((category) => (<react_native_paper_1.Chip key={category} selected={formData.businessCategory === category} onPress={() => handleChange('businessCategory', category)} style={[
|
|
345
342
|
styles.categoryChip,
|
|
346
343
|
formData.businessCategory === category && styles.categoryChipSelected
|
|
347
344
|
]} textStyle={formData.businessCategory === category && styles.categoryChipTextSelected} mode="outlined" compact>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
345
|
+
{category}
|
|
346
|
+
</react_native_paper_1.Chip>))}
|
|
347
|
+
</react_native_1.View>
|
|
348
|
+
</react_native_1.ScrollView>
|
|
349
|
+
</react_native_1.View>
|
|
353
350
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
351
|
+
{/* Country */}
|
|
352
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
353
|
+
<react_native_1.Text style={styles.label}>Country</react_native_1.Text>
|
|
354
|
+
<CountryDropdown_1.default value={formData.country || 'India'} onChange={(country) => {
|
|
358
355
|
handleChange('country', country);
|
|
359
356
|
handleChange('nationality', country);
|
|
360
357
|
}} label=""/>
|
|
361
|
-
|
|
358
|
+
</react_native_1.View>
|
|
362
359
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
360
|
+
{/* Date of Birth */}
|
|
361
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
362
|
+
<react_native_1.Text style={styles.label}>Date of Birth</react_native_1.Text>
|
|
363
|
+
<react_native_1.TouchableOpacity onPress={() => setShowDatePicker(true)} activeOpacity={0.7}>
|
|
364
|
+
<react_native_1.View pointerEvents="none">
|
|
365
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.dob} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="cake" color="#6B7280"/>} right={<react_native_paper_1.TextInput.Icon icon="calendar" color="#6B7280"/>} placeholder="DD/MM/YYYY" placeholderTextColor="#9CA3AF"/>
|
|
366
|
+
</react_native_1.View>
|
|
367
|
+
</react_native_1.TouchableOpacity>
|
|
368
|
+
</react_native_1.View>
|
|
372
369
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
370
|
+
{/* Submit Button */}
|
|
371
|
+
<react_native_1.Animated.View style={{ transform: [{ scale: scaleAnim }] }}>
|
|
372
|
+
<react_native_paper_1.Button mode="contained" onPress={handleSubmit} disabled={!isFormValid()} style={[
|
|
376
373
|
styles.button,
|
|
377
374
|
!isFormValid() && styles.buttonDisabled
|
|
378
375
|
]} labelStyle={styles.buttonLabel} contentStyle={styles.buttonContent}>
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
376
|
+
Continue
|
|
377
|
+
</react_native_paper_1.Button>
|
|
378
|
+
</react_native_1.Animated.View>
|
|
382
379
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
380
|
+
{showDatePicker && (<datetimepicker_1.default value={formData.dob ? new Date(formData.dob) : new Date()} mode="date" display={react_native_1.Platform.OS === 'ios' ? 'spinner' : 'default'} onChange={handleDateChange} maximumDate={new Date()}/>)}
|
|
381
|
+
</react_native_paper_1.Surface>
|
|
382
|
+
</react_native_1.ScrollView>
|
|
383
|
+
</expo_linear_gradient_1.LinearGradient>
|
|
384
|
+
</react_native_1.Animated.View>
|
|
385
|
+
</react_native_1.KeyboardAvoidingView>);
|
|
388
386
|
};
|
|
389
387
|
const styles = react_native_1.StyleSheet.create({
|
|
390
388
|
container: {
|
|
@@ -396,6 +394,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
396
394
|
},
|
|
397
395
|
scrollContent: {
|
|
398
396
|
padding: 12,
|
|
397
|
+
paddingBottom: 24,
|
|
399
398
|
},
|
|
400
399
|
headerCard: {
|
|
401
400
|
flexDirection: 'row',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Merchant, Mode, KYCStatus } from '../../types/merchantTypes';
|
|
3
3
|
interface KYCVerificationProps {
|
|
4
|
-
initialData: Partial<
|
|
4
|
+
initialData: Partial<Merchant>;
|
|
5
5
|
mode: Mode;
|
|
6
6
|
kycStatus: KYCStatus;
|
|
7
|
-
onNext: (data: Partial<
|
|
7
|
+
onNext: (data: Partial<Merchant>) => void;
|
|
8
8
|
onBack: () => void;
|
|
9
9
|
}
|
|
10
10
|
declare const KYCVerification: React.FC<KYCVerificationProps>;
|