@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,581 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// components/steps/BasicDetailsForm.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 datetimepicker_1 = __importDefault(require("@react-native-community/datetimepicker"));
|
|
44
|
+
const CountryDropdown_1 = __importDefault(require("../common/CountryDropdown"));
|
|
45
|
+
const expo_linear_gradient_1 = require("expo-linear-gradient");
|
|
46
|
+
const BasicDetailsForm = ({ initialData, onNext, errors, setErrors, }) => {
|
|
47
|
+
// Animation values
|
|
48
|
+
const fadeAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
49
|
+
const slideAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(50)).current;
|
|
50
|
+
const scaleAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0.95)).current;
|
|
51
|
+
const [formData, setFormData] = (0, react_1.useState)({
|
|
52
|
+
sellerName: '',
|
|
53
|
+
sellerEmail: '',
|
|
54
|
+
sellerPhone: '',
|
|
55
|
+
businessName: '',
|
|
56
|
+
businessType: 'individual',
|
|
57
|
+
businessCategory: '',
|
|
58
|
+
country: 'India',
|
|
59
|
+
nationality: 'Indian',
|
|
60
|
+
dob: '',
|
|
61
|
+
...initialData,
|
|
62
|
+
});
|
|
63
|
+
const [showDatePicker, setShowDatePicker] = (0, react_1.useState)(false);
|
|
64
|
+
const [touched, setTouched] = (0, react_1.useState)({});
|
|
65
|
+
const [focusedField, setFocusedField] = (0, react_1.useState)(null);
|
|
66
|
+
const [localErrors, setLocalErrors] = (0, react_1.useState)({});
|
|
67
|
+
// Animation on mount
|
|
68
|
+
(0, react_1.useEffect)(() => {
|
|
69
|
+
react_native_1.Animated.parallel([
|
|
70
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
71
|
+
toValue: 1,
|
|
72
|
+
duration: 500,
|
|
73
|
+
useNativeDriver: true,
|
|
74
|
+
}),
|
|
75
|
+
react_native_1.Animated.timing(slideAnim, {
|
|
76
|
+
toValue: 0,
|
|
77
|
+
duration: 500,
|
|
78
|
+
useNativeDriver: true,
|
|
79
|
+
}),
|
|
80
|
+
react_native_1.Animated.spring(scaleAnim, {
|
|
81
|
+
toValue: 1,
|
|
82
|
+
friction: 8,
|
|
83
|
+
tension: 40,
|
|
84
|
+
useNativeDriver: true,
|
|
85
|
+
}),
|
|
86
|
+
]).start();
|
|
87
|
+
}, []);
|
|
88
|
+
const validateField = (field, value) => {
|
|
89
|
+
switch (field) {
|
|
90
|
+
case 'sellerName':
|
|
91
|
+
if (!value?.trim())
|
|
92
|
+
return 'Seller name is required';
|
|
93
|
+
if (value.length < 2)
|
|
94
|
+
return 'Name must be at least 2 characters';
|
|
95
|
+
if (value.length > 50)
|
|
96
|
+
return 'Name must be less than 50 characters';
|
|
97
|
+
return undefined;
|
|
98
|
+
case 'sellerEmail':
|
|
99
|
+
if (!value?.trim())
|
|
100
|
+
return 'Email is required';
|
|
101
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
102
|
+
if (!emailRegex.test(value))
|
|
103
|
+
return 'Invalid email format';
|
|
104
|
+
return undefined;
|
|
105
|
+
case 'sellerPhone':
|
|
106
|
+
if (value && !/^\d{10}$/.test(value.replace(/\D/g, ''))) {
|
|
107
|
+
return 'Phone must be 10 digits';
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
case 'businessName':
|
|
111
|
+
if (formData.businessType === 'company' && !value?.trim()) {
|
|
112
|
+
return 'Business name is required for companies';
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
default:
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const handleChange = (field, value) => {
|
|
120
|
+
setFormData(prev => ({ ...prev, [field]: value }));
|
|
121
|
+
// Validate on change
|
|
122
|
+
const error = validateField(field, value);
|
|
123
|
+
const newErrors = { ...localErrors };
|
|
124
|
+
if (error) {
|
|
125
|
+
newErrors[field] = error;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
delete newErrors[field];
|
|
129
|
+
}
|
|
130
|
+
setLocalErrors(newErrors);
|
|
131
|
+
setErrors(newErrors);
|
|
132
|
+
};
|
|
133
|
+
const handleBlur = (field) => {
|
|
134
|
+
setFocusedField(null);
|
|
135
|
+
setTouched(prev => ({ ...prev, [field]: true }));
|
|
136
|
+
const error = validateField(field, formData[field]);
|
|
137
|
+
const newErrors = { ...localErrors };
|
|
138
|
+
if (error) {
|
|
139
|
+
newErrors[field] = error;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
delete newErrors[field];
|
|
143
|
+
}
|
|
144
|
+
setLocalErrors(newErrors);
|
|
145
|
+
setErrors(newErrors);
|
|
146
|
+
};
|
|
147
|
+
const handleFocus = (field) => {
|
|
148
|
+
setFocusedField(field);
|
|
149
|
+
};
|
|
150
|
+
const handleDateChange = (event, selectedDate) => {
|
|
151
|
+
setShowDatePicker(react_native_1.Platform.OS === 'ios');
|
|
152
|
+
if (selectedDate) {
|
|
153
|
+
const formattedDate = selectedDate.toISOString().split('T')[0];
|
|
154
|
+
handleChange('dob', formattedDate);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const validateForm = () => {
|
|
158
|
+
const newErrors = {};
|
|
159
|
+
const requiredFields = ['sellerName', 'sellerEmail'];
|
|
160
|
+
if (formData.businessType === 'company') {
|
|
161
|
+
requiredFields.push('businessName');
|
|
162
|
+
}
|
|
163
|
+
requiredFields.forEach(field => {
|
|
164
|
+
const error = validateField(field, formData[field]);
|
|
165
|
+
if (error)
|
|
166
|
+
newErrors[field] = error;
|
|
167
|
+
});
|
|
168
|
+
setLocalErrors(newErrors);
|
|
169
|
+
setErrors(newErrors);
|
|
170
|
+
return Object.keys(newErrors).length === 0;
|
|
171
|
+
};
|
|
172
|
+
const handleSubmit = () => {
|
|
173
|
+
react_native_1.Keyboard.dismiss();
|
|
174
|
+
if (validateForm()) {
|
|
175
|
+
// Animate button press
|
|
176
|
+
react_native_1.Animated.sequence([
|
|
177
|
+
react_native_1.Animated.timing(scaleAnim, {
|
|
178
|
+
toValue: 0.95,
|
|
179
|
+
duration: 100,
|
|
180
|
+
useNativeDriver: true,
|
|
181
|
+
}),
|
|
182
|
+
react_native_1.Animated.timing(scaleAnim, {
|
|
183
|
+
toValue: 1,
|
|
184
|
+
duration: 100,
|
|
185
|
+
useNativeDriver: true,
|
|
186
|
+
}),
|
|
187
|
+
]).start(() => {
|
|
188
|
+
onNext(formData);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const isFormValid = () => {
|
|
193
|
+
const requiredFields = ['sellerName', 'sellerEmail'];
|
|
194
|
+
if (formData.businessType === 'company') {
|
|
195
|
+
requiredFields.push('businessName');
|
|
196
|
+
}
|
|
197
|
+
// Check if all required fields have values
|
|
198
|
+
const allRequiredFilled = requiredFields.every(field => {
|
|
199
|
+
const value = formData[field];
|
|
200
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
201
|
+
});
|
|
202
|
+
// Check if there are any errors
|
|
203
|
+
const hasNoErrors = Object.keys(localErrors).length === 0;
|
|
204
|
+
console.log('Form Valid Check:', {
|
|
205
|
+
allRequiredFilled,
|
|
206
|
+
hasNoErrors,
|
|
207
|
+
localErrors,
|
|
208
|
+
formData: {
|
|
209
|
+
sellerName: formData.sellerName,
|
|
210
|
+
sellerEmail: formData.sellerEmail,
|
|
211
|
+
businessName: formData.businessName,
|
|
212
|
+
businessType: formData.businessType
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
return allRequiredFilled && hasNoErrors;
|
|
216
|
+
};
|
|
217
|
+
const businessCategories = [
|
|
218
|
+
'Electronics',
|
|
219
|
+
'Fashion',
|
|
220
|
+
'Home & Living',
|
|
221
|
+
'Books',
|
|
222
|
+
'Sports',
|
|
223
|
+
'Toys',
|
|
224
|
+
'Automotive',
|
|
225
|
+
'Health',
|
|
226
|
+
'Food',
|
|
227
|
+
'Other',
|
|
228
|
+
];
|
|
229
|
+
return (<react_native_1.Animated.View style={[
|
|
230
|
+
styles.container,
|
|
231
|
+
{
|
|
232
|
+
opacity: fadeAnim,
|
|
233
|
+
transform: [
|
|
234
|
+
{ translateY: slideAnim },
|
|
235
|
+
{ scale: scaleAnim }
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
]}>
|
|
239
|
+
<expo_linear_gradient_1.LinearGradient colors={['#FFFFFF', '#F8F9FA']} style={styles.gradient}>
|
|
240
|
+
<react_native_1.ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent} keyboardShouldPersistTaps="handled">
|
|
241
|
+
{/* Header Card */}
|
|
242
|
+
<react_native_paper_1.Surface style={styles.headerCard}>
|
|
243
|
+
<react_native_1.View style={styles.headerIcon}>
|
|
244
|
+
<react_native_paper_1.IconButton icon="account-details" size={28} iconColor="#0066CC"/>
|
|
245
|
+
</react_native_1.View>
|
|
246
|
+
<react_native_1.View style={styles.headerText}>
|
|
247
|
+
<react_native_paper_1.Title style={styles.title}>Basic Information</react_native_paper_1.Title>
|
|
248
|
+
<react_native_1.Text style={styles.subtitle}>
|
|
249
|
+
Tell us about yourself
|
|
250
|
+
</react_native_1.Text>
|
|
251
|
+
</react_native_1.View>
|
|
252
|
+
</react_native_paper_1.Surface>
|
|
253
|
+
|
|
254
|
+
{/* Form Card */}
|
|
255
|
+
<react_native_paper_1.Surface style={styles.formCard}>
|
|
256
|
+
{/* Compact Progress Steps */}
|
|
257
|
+
<react_native_1.View style={styles.progressContainer}>
|
|
258
|
+
<react_native_1.View style={styles.progressStep}>
|
|
259
|
+
<expo_linear_gradient_1.LinearGradient colors={['#0066CC', '#0099FF']} style={styles.progressDot}/>
|
|
260
|
+
<react_native_1.Text style={styles.progressTextActive}>Basic</react_native_1.Text>
|
|
261
|
+
</react_native_1.View>
|
|
262
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
263
|
+
<react_native_1.View style={styles.progressStep}>
|
|
264
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotInactive]}/>
|
|
265
|
+
<react_native_1.Text style={styles.progressText}>KYC</react_native_1.Text>
|
|
266
|
+
</react_native_1.View>
|
|
267
|
+
<react_native_1.View style={styles.progressLine}/>
|
|
268
|
+
<react_native_1.View style={styles.progressStep}>
|
|
269
|
+
<react_native_1.View style={[styles.progressDot, styles.progressDotInactive]}/>
|
|
270
|
+
<react_native_1.Text style={styles.progressText}>Bank</react_native_1.Text>
|
|
271
|
+
</react_native_1.View>
|
|
272
|
+
</react_native_1.View>
|
|
273
|
+
|
|
274
|
+
{/* Seller Name */}
|
|
275
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
276
|
+
<react_native_1.Text style={styles.label}>
|
|
277
|
+
Full Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
278
|
+
</react_native_1.Text>
|
|
279
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.sellerName} onChangeText={(text) => handleChange('sellerName', text)} onBlur={() => handleBlur('sellerName')} onFocus={() => handleFocus('sellerName')} error={!!localErrors.sellerName} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="account" color="#6B7280"/>} placeholder="John Doe" placeholderTextColor="#9CA3AF"/>
|
|
280
|
+
{localErrors.sellerName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
281
|
+
{localErrors.sellerName}
|
|
282
|
+
</react_native_paper_1.HelperText>)}
|
|
283
|
+
</react_native_1.View>
|
|
284
|
+
|
|
285
|
+
{/* Email */}
|
|
286
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
287
|
+
<react_native_1.Text style={styles.label}>
|
|
288
|
+
Email <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
289
|
+
</react_native_1.Text>
|
|
290
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.sellerEmail} onChangeText={(text) => handleChange('sellerEmail', text)} onBlur={() => handleBlur('sellerEmail')} onFocus={() => handleFocus('sellerEmail')} keyboardType="email-address" autoCapitalize="none" error={!!localErrors.sellerEmail} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="email" color="#6B7280"/>} placeholder="john@example.com" placeholderTextColor="#9CA3AF"/>
|
|
291
|
+
{localErrors.sellerEmail && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
292
|
+
{localErrors.sellerEmail}
|
|
293
|
+
</react_native_paper_1.HelperText>)}
|
|
294
|
+
</react_native_1.View>
|
|
295
|
+
|
|
296
|
+
{/* Phone */}
|
|
297
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
298
|
+
<react_native_1.Text style={styles.label}>Phone Number</react_native_1.Text>
|
|
299
|
+
<react_native_paper_1.TextInput mode="outlined" value={formData.sellerPhone} onChangeText={(text) => handleChange('sellerPhone', text)} onBlur={() => handleBlur('sellerPhone')} onFocus={() => handleFocus('sellerPhone')} keyboardType="phone-pad" error={!!localErrors.sellerPhone} style={styles.input} outlineColor="#E5E7EB" activeOutlineColor="#0066CC" left={<react_native_paper_1.TextInput.Icon icon="phone" color="#6B7280"/>} placeholder="9876543210" placeholderTextColor="#9CA3AF"/>
|
|
300
|
+
{localErrors.sellerPhone && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
301
|
+
{localErrors.sellerPhone}
|
|
302
|
+
</react_native_paper_1.HelperText>)}
|
|
303
|
+
</react_native_1.View>
|
|
304
|
+
|
|
305
|
+
{/* Business Type - Compact Design */}
|
|
306
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
307
|
+
<react_native_1.Text style={styles.label}>
|
|
308
|
+
Business Type <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
309
|
+
</react_native_1.Text>
|
|
310
|
+
<react_native_1.View style={styles.businessTypeContainer}>
|
|
311
|
+
<react_native_1.TouchableOpacity style={[
|
|
312
|
+
styles.businessTypeButton,
|
|
313
|
+
formData.businessType === 'individual' && styles.businessTypeButtonActive
|
|
314
|
+
]} onPress={() => handleChange('businessType', 'individual')}>
|
|
315
|
+
<react_native_paper_1.IconButton icon="account" size={20} iconColor={formData.businessType === 'individual' ? '#0066CC' : '#6B7280'}/>
|
|
316
|
+
<react_native_1.Text style={[
|
|
317
|
+
styles.businessTypeText,
|
|
318
|
+
formData.businessType === 'individual' && styles.businessTypeTextActive
|
|
319
|
+
]}>
|
|
320
|
+
Individual
|
|
321
|
+
</react_native_1.Text>
|
|
322
|
+
</react_native_1.TouchableOpacity>
|
|
323
|
+
|
|
324
|
+
<react_native_1.TouchableOpacity style={[
|
|
325
|
+
styles.businessTypeButton,
|
|
326
|
+
formData.businessType === 'company' && styles.businessTypeButtonActive
|
|
327
|
+
]} onPress={() => handleChange('businessType', 'company')}>
|
|
328
|
+
<react_native_paper_1.IconButton icon="office-building" size={20} iconColor={formData.businessType === 'company' ? '#0066CC' : '#6B7280'}/>
|
|
329
|
+
<react_native_1.Text style={[
|
|
330
|
+
styles.businessTypeText,
|
|
331
|
+
formData.businessType === 'company' && styles.businessTypeTextActive
|
|
332
|
+
]}>
|
|
333
|
+
Company
|
|
334
|
+
</react_native_1.Text>
|
|
335
|
+
</react_native_1.TouchableOpacity>
|
|
336
|
+
</react_native_1.View>
|
|
337
|
+
</react_native_1.View>
|
|
338
|
+
|
|
339
|
+
{/* Business Name - Show only for company */}
|
|
340
|
+
{formData.businessType === 'company' && (<react_native_1.View style={styles.fieldContainer}>
|
|
341
|
+
<react_native_1.Text style={styles.label}>
|
|
342
|
+
Business Name <react_native_1.Text style={styles.requiredStar}>*</react_native_1.Text>
|
|
343
|
+
</react_native_1.Text>
|
|
344
|
+
<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"/>
|
|
345
|
+
{localErrors.businessName && (<react_native_paper_1.HelperText type="error" style={styles.errorText}>
|
|
346
|
+
{localErrors.businessName}
|
|
347
|
+
</react_native_paper_1.HelperText>)}
|
|
348
|
+
</react_native_1.View>)}
|
|
349
|
+
|
|
350
|
+
{/* Business Category - Simplified */}
|
|
351
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
352
|
+
<react_native_1.Text style={styles.label}>Category</react_native_1.Text>
|
|
353
|
+
<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.categoryScroll}>
|
|
354
|
+
<react_native_1.View style={styles.categoryContainer}>
|
|
355
|
+
{businessCategories.map((category) => (<react_native_paper_1.Chip key={category} selected={formData.businessCategory === category} onPress={() => handleChange('businessCategory', category)} style={[
|
|
356
|
+
styles.categoryChip,
|
|
357
|
+
formData.businessCategory === category && styles.categoryChipSelected
|
|
358
|
+
]} textStyle={formData.businessCategory === category && styles.categoryChipTextSelected} mode="outlined" compact>
|
|
359
|
+
{category}
|
|
360
|
+
</react_native_paper_1.Chip>))}
|
|
361
|
+
</react_native_1.View>
|
|
362
|
+
</react_native_1.ScrollView>
|
|
363
|
+
</react_native_1.View>
|
|
364
|
+
|
|
365
|
+
{/* Country */}
|
|
366
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
367
|
+
<react_native_1.Text style={styles.label}>Country</react_native_1.Text>
|
|
368
|
+
<CountryDropdown_1.default value={formData.country || 'India'} onChange={(country) => {
|
|
369
|
+
handleChange('country', country);
|
|
370
|
+
handleChange('nationality', country);
|
|
371
|
+
}} label=""/>
|
|
372
|
+
</react_native_1.View>
|
|
373
|
+
|
|
374
|
+
{/* Date of Birth */}
|
|
375
|
+
<react_native_1.View style={styles.fieldContainer}>
|
|
376
|
+
<react_native_1.Text style={styles.label}>Date of Birth</react_native_1.Text>
|
|
377
|
+
<react_native_1.TouchableOpacity onPress={() => setShowDatePicker(true)} activeOpacity={0.7}>
|
|
378
|
+
<react_native_1.View pointerEvents="none">
|
|
379
|
+
<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"/>
|
|
380
|
+
</react_native_1.View>
|
|
381
|
+
</react_native_1.TouchableOpacity>
|
|
382
|
+
</react_native_1.View>
|
|
383
|
+
|
|
384
|
+
{/* Submit Button */}
|
|
385
|
+
<react_native_1.Animated.View style={{ transform: [{ scale: scaleAnim }] }}>
|
|
386
|
+
<react_native_paper_1.Button mode="contained" onPress={handleSubmit} disabled={!isFormValid()} style={[
|
|
387
|
+
styles.button,
|
|
388
|
+
!isFormValid() && styles.buttonDisabled
|
|
389
|
+
]} labelStyle={styles.buttonLabel} contentStyle={styles.buttonContent}>
|
|
390
|
+
Continue
|
|
391
|
+
</react_native_paper_1.Button>
|
|
392
|
+
</react_native_1.Animated.View>
|
|
393
|
+
|
|
394
|
+
{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()}/>)}
|
|
395
|
+
</react_native_paper_1.Surface>
|
|
396
|
+
</react_native_1.ScrollView>
|
|
397
|
+
</expo_linear_gradient_1.LinearGradient>
|
|
398
|
+
</react_native_1.Animated.View>);
|
|
399
|
+
};
|
|
400
|
+
const styles = react_native_1.StyleSheet.create({
|
|
401
|
+
container: {
|
|
402
|
+
flex: 1,
|
|
403
|
+
backgroundColor: '#FFFFFF',
|
|
404
|
+
},
|
|
405
|
+
gradient: {
|
|
406
|
+
flex: 1,
|
|
407
|
+
},
|
|
408
|
+
scrollContent: {
|
|
409
|
+
padding: 12,
|
|
410
|
+
},
|
|
411
|
+
headerCard: {
|
|
412
|
+
flexDirection: 'row',
|
|
413
|
+
alignItems: 'center',
|
|
414
|
+
padding: 16,
|
|
415
|
+
backgroundColor: '#FFFFFF',
|
|
416
|
+
borderRadius: 16,
|
|
417
|
+
marginBottom: 12,
|
|
418
|
+
elevation: 2,
|
|
419
|
+
shadowColor: '#000',
|
|
420
|
+
shadowOffset: { width: 0, height: 2 },
|
|
421
|
+
shadowOpacity: 0.1,
|
|
422
|
+
shadowRadius: 4,
|
|
423
|
+
},
|
|
424
|
+
headerIcon: {
|
|
425
|
+
width: 48,
|
|
426
|
+
height: 48,
|
|
427
|
+
borderRadius: 24,
|
|
428
|
+
backgroundColor: '#F0F7FF',
|
|
429
|
+
justifyContent: 'center',
|
|
430
|
+
alignItems: 'center',
|
|
431
|
+
marginRight: 12,
|
|
432
|
+
},
|
|
433
|
+
headerText: {
|
|
434
|
+
flex: 1,
|
|
435
|
+
},
|
|
436
|
+
title: {
|
|
437
|
+
fontSize: 20,
|
|
438
|
+
fontWeight: '700',
|
|
439
|
+
color: '#111827',
|
|
440
|
+
},
|
|
441
|
+
subtitle: {
|
|
442
|
+
fontSize: 13,
|
|
443
|
+
color: '#6B7280',
|
|
444
|
+
marginTop: 2,
|
|
445
|
+
},
|
|
446
|
+
formCard: {
|
|
447
|
+
backgroundColor: '#FFFFFF',
|
|
448
|
+
borderRadius: 20,
|
|
449
|
+
padding: 16,
|
|
450
|
+
elevation: 2,
|
|
451
|
+
shadowColor: '#000',
|
|
452
|
+
shadowOffset: { width: 0, height: 2 },
|
|
453
|
+
shadowOpacity: 0.1,
|
|
454
|
+
shadowRadius: 4,
|
|
455
|
+
},
|
|
456
|
+
progressContainer: {
|
|
457
|
+
flexDirection: 'row',
|
|
458
|
+
alignItems: 'center',
|
|
459
|
+
justifyContent: 'center',
|
|
460
|
+
marginBottom: 20,
|
|
461
|
+
paddingHorizontal: 8,
|
|
462
|
+
},
|
|
463
|
+
progressStep: {
|
|
464
|
+
alignItems: 'center',
|
|
465
|
+
},
|
|
466
|
+
progressDot: {
|
|
467
|
+
width: 24,
|
|
468
|
+
height: 24,
|
|
469
|
+
borderRadius: 12,
|
|
470
|
+
backgroundColor: '#0066CC',
|
|
471
|
+
},
|
|
472
|
+
progressDotInactive: {
|
|
473
|
+
backgroundColor: '#E5E7EB',
|
|
474
|
+
},
|
|
475
|
+
progressLine: {
|
|
476
|
+
width: 30,
|
|
477
|
+
height: 2,
|
|
478
|
+
backgroundColor: '#E5E7EB',
|
|
479
|
+
marginHorizontal: 4,
|
|
480
|
+
},
|
|
481
|
+
progressText: {
|
|
482
|
+
fontSize: 10,
|
|
483
|
+
color: '#9CA3AF',
|
|
484
|
+
marginTop: 4,
|
|
485
|
+
},
|
|
486
|
+
progressTextActive: {
|
|
487
|
+
fontSize: 10,
|
|
488
|
+
color: '#0066CC',
|
|
489
|
+
marginTop: 4,
|
|
490
|
+
fontWeight: '600',
|
|
491
|
+
},
|
|
492
|
+
fieldContainer: {
|
|
493
|
+
marginBottom: 16,
|
|
494
|
+
},
|
|
495
|
+
label: {
|
|
496
|
+
fontSize: 13,
|
|
497
|
+
fontWeight: '500',
|
|
498
|
+
color: '#374151',
|
|
499
|
+
marginBottom: 6,
|
|
500
|
+
},
|
|
501
|
+
requiredStar: {
|
|
502
|
+
color: '#EF4444',
|
|
503
|
+
},
|
|
504
|
+
input: {
|
|
505
|
+
backgroundColor: '#FFFFFF',
|
|
506
|
+
fontSize: 14,
|
|
507
|
+
height: 48,
|
|
508
|
+
},
|
|
509
|
+
errorText: {
|
|
510
|
+
fontSize: 11,
|
|
511
|
+
color: '#EF4444',
|
|
512
|
+
marginTop: 2,
|
|
513
|
+
},
|
|
514
|
+
businessTypeContainer: {
|
|
515
|
+
flexDirection: 'row',
|
|
516
|
+
gap: 8,
|
|
517
|
+
},
|
|
518
|
+
businessTypeButton: {
|
|
519
|
+
flex: 1,
|
|
520
|
+
flexDirection: 'row',
|
|
521
|
+
alignItems: 'center',
|
|
522
|
+
justifyContent: 'center',
|
|
523
|
+
paddingVertical: 6,
|
|
524
|
+
paddingHorizontal: 8,
|
|
525
|
+
backgroundColor: '#F9FAFB',
|
|
526
|
+
borderRadius: 8,
|
|
527
|
+
borderWidth: 1,
|
|
528
|
+
borderColor: '#E5E7EB',
|
|
529
|
+
},
|
|
530
|
+
businessTypeButtonActive: {
|
|
531
|
+
borderColor: '#0066CC',
|
|
532
|
+
backgroundColor: '#F0F7FF',
|
|
533
|
+
},
|
|
534
|
+
businessTypeText: {
|
|
535
|
+
fontSize: 13,
|
|
536
|
+
color: '#6B7280',
|
|
537
|
+
marginLeft: -4,
|
|
538
|
+
},
|
|
539
|
+
businessTypeTextActive: {
|
|
540
|
+
color: '#0066CC',
|
|
541
|
+
fontWeight: '500',
|
|
542
|
+
},
|
|
543
|
+
categoryScroll: {
|
|
544
|
+
marginTop: 4,
|
|
545
|
+
},
|
|
546
|
+
categoryContainer: {
|
|
547
|
+
flexDirection: 'row',
|
|
548
|
+
paddingVertical: 2,
|
|
549
|
+
},
|
|
550
|
+
categoryChip: {
|
|
551
|
+
marginRight: 6,
|
|
552
|
+
backgroundColor: '#FFFFFF',
|
|
553
|
+
borderColor: '#E5E7EB',
|
|
554
|
+
height: 32,
|
|
555
|
+
},
|
|
556
|
+
categoryChipSelected: {
|
|
557
|
+
backgroundColor: '#0066CC',
|
|
558
|
+
borderColor: '#0066CC',
|
|
559
|
+
},
|
|
560
|
+
categoryChipTextSelected: {
|
|
561
|
+
color: '#FFFFFF',
|
|
562
|
+
},
|
|
563
|
+
button: {
|
|
564
|
+
marginTop: 20,
|
|
565
|
+
borderRadius: 12,
|
|
566
|
+
backgroundColor: '#0066CC',
|
|
567
|
+
},
|
|
568
|
+
buttonDisabled: {
|
|
569
|
+
backgroundColor: '#9CA3AF',
|
|
570
|
+
opacity: 0.7,
|
|
571
|
+
},
|
|
572
|
+
buttonLabel: {
|
|
573
|
+
fontSize: 15,
|
|
574
|
+
fontWeight: '600',
|
|
575
|
+
color: '#FFFFFF',
|
|
576
|
+
},
|
|
577
|
+
buttonContent: {
|
|
578
|
+
paddingVertical: 6,
|
|
579
|
+
},
|
|
580
|
+
});
|
|
581
|
+
exports.default = BasicDetailsForm;
|