@oxyhq/services 5.13.4 → 5.13.11
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/lib/commonjs/core/HttpClient.js +1 -1
- package/lib/commonjs/core/HttpClient.js.map +1 -1
- package/lib/commonjs/core/OxyServices.js +91 -30
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/index.js +0 -7
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/i18n/locales/en-US.json +222 -6
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +24 -22
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +35 -14
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +36 -1
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +150 -5
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +475 -319
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +217 -0
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +911 -213
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +131 -0
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +258 -0
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +211 -0
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +0 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +307 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -7
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +205 -0
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +239 -0
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInScreen.js +14 -29
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/utils/asyncUtils.js +1 -0
- package/lib/commonjs/utils/asyncUtils.js.map +1 -1
- package/lib/commonjs/utils/cache.js +4 -4
- package/lib/commonjs/utils/cache.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -6
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/core/HttpClient.js +1 -1
- package/lib/module/core/HttpClient.js.map +1 -1
- package/lib/module/core/OxyServices.js +90 -29
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/index.js +1 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/i18n/locales/en-US.json +222 -6
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +24 -22
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +40 -17
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +36 -1
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +151 -6
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +475 -319
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +212 -0
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +913 -212
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +126 -0
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -0
- package/lib/module/ui/screens/HistoryViewScreen.js +253 -0
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -0
- package/lib/module/ui/screens/LegalDocumentsScreen.js +206 -0
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +0 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +302 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/ProfileScreen.js +1 -7
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +200 -0
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -0
- package/lib/module/ui/screens/SearchSettingsScreen.js +234 -0
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInScreen.js +14 -29
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/utils/asyncUtils.js +1 -0
- package/lib/module/utils/asyncUtils.js.map +1 -1
- package/lib/module/utils/cache.js +3 -3
- package/lib/module/utils/cache.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +35 -23
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +1 -1
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/sonner.d.ts +1 -0
- package/lib/typescript/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/types/expo-document-picker.d.ts +36 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
- package/lib/typescript/utils/cache.d.ts +3 -3
- package/lib/typescript/utils/cache.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +1 -1
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/HttpClient.ts +1 -1
- package/src/core/OxyServices.ts +88 -30
- package/src/core/index.ts +1 -1
- package/src/i18n/locales/en-US.json +222 -6
- package/src/index.ts +1 -1
- package/src/lib/sonner.ts +1 -0
- package/src/types/expo-document-picker.d.ts +36 -0
- package/src/ui/components/GroupedItem.tsx +23 -21
- package/src/ui/components/OxyProvider.tsx +33 -11
- package/src/ui/navigation/routes.ts +42 -0
- package/src/ui/screens/AccountOverviewScreen.tsx +175 -5
- package/src/ui/screens/AccountSettingsScreen.tsx +521 -360
- package/src/ui/screens/AccountVerificationScreen.tsx +235 -0
- package/src/ui/screens/FileManagementScreen.tsx +934 -208
- package/src/ui/screens/HelpSupportScreen.tsx +143 -0
- package/src/ui/screens/HistoryViewScreen.tsx +280 -0
- package/src/ui/screens/LegalDocumentsScreen.tsx +220 -0
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +0 -1
- package/src/ui/screens/PrivacySettingsScreen.tsx +332 -0
- package/src/ui/screens/ProfileScreen.tsx +1 -8
- package/src/ui/screens/SavesCollectionsScreen.tsx +222 -0
- package/src/ui/screens/SearchSettingsScreen.tsx +219 -0
- package/src/ui/screens/SignInScreen.tsx +19 -35
- package/src/utils/asyncUtils.ts +1 -0
- package/src/utils/cache.ts +3 -3
- package/src/utils/index.ts +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.README.md +0 -337
- package/lib/commonjs/ui/components/internal/TextField.md +0 -436
- package/lib/commonjs/ui/styles/FONTS.md +0 -126
- package/lib/module/ui/components/StepBasedScreen.README.md +0 -337
- package/lib/module/ui/components/internal/TextField.md +0 -436
- package/lib/module/ui/styles/FONTS.md +0 -126
- package/src/ui/components/StepBasedScreen.README.md +0 -337
- package/src/ui/components/internal/TextField.md +0 -436
- package/src/ui/styles/FONTS.md +0 -126
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
# StepBasedScreen Component
|
|
2
|
-
|
|
3
|
-
A reusable, production-ready React Native component for building multi-step flows with smooth animations and consistent UX patterns.
|
|
4
|
-
|
|
5
|
-
## 🚀 Features
|
|
6
|
-
|
|
7
|
-
- **Smooth Animations**: Built-in fade/slide animations using React Native Reanimated
|
|
8
|
-
- **Progress Indicators**: Automatic progress bars and step indicators
|
|
9
|
-
- **Type Safety**: Full TypeScript support with comprehensive interfaces
|
|
10
|
-
- **Flexible Configuration**: Highly customizable step definitions
|
|
11
|
-
- **Performance Optimized**: Efficient re-rendering and memory management
|
|
12
|
-
- **Accessibility**: Proper focus management and screen reader support
|
|
13
|
-
|
|
14
|
-
## 📦 Installation
|
|
15
|
-
|
|
16
|
-
The component is already integrated into your project structure. Simply import it:
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
import StepBasedScreen, { type StepConfig } from '../components/StepBasedScreen';
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 🔧 Basic Usage
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import React, { useState, useCallback } from 'react';
|
|
26
|
-
import StepBasedScreen, { type StepConfig } from './StepBasedScreen';
|
|
27
|
-
|
|
28
|
-
const MyMultiStepScreen: React.FC = () => {
|
|
29
|
-
const [formData, setFormData] = useState({ name: '', email: '' });
|
|
30
|
-
|
|
31
|
-
// Define your step components
|
|
32
|
-
const Step1: React.FC<any> = ({ nextStep }) => (
|
|
33
|
-
<View>
|
|
34
|
-
<Text>Enter your name</Text>
|
|
35
|
-
<TextInput
|
|
36
|
-
value={formData.name}
|
|
37
|
-
onChangeText={(text) => setFormData(prev => ({ ...prev, name: text }))}
|
|
38
|
-
/>
|
|
39
|
-
<Button title="Next" onPress={nextStep} />
|
|
40
|
-
</View>
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const Step2: React.FC<any> = ({ prevStep, onComplete }) => (
|
|
44
|
-
<View>
|
|
45
|
-
<Text>Enter your email</Text>
|
|
46
|
-
<TextInput
|
|
47
|
-
value={formData.email}
|
|
48
|
-
onChangeText={(text) => setFormData(prev => ({ ...prev, email: text }))}
|
|
49
|
-
/>
|
|
50
|
-
<Button title="Back" onPress={prevStep} />
|
|
51
|
-
<Button title="Complete" onPress={onComplete} />
|
|
52
|
-
</View>
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
// Configure your steps
|
|
56
|
-
const steps: StepConfig[] = [
|
|
57
|
-
{
|
|
58
|
-
id: 'name',
|
|
59
|
-
component: Step1,
|
|
60
|
-
canProceed: () => formData.name.trim().length > 0,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'email',
|
|
64
|
-
component: Step2,
|
|
65
|
-
canProceed: () => formData.email.trim().length > 0,
|
|
66
|
-
},
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
const handleComplete = useCallback((stepData: any[]) => {
|
|
70
|
-
console.log('Form completed with data:', stepData);
|
|
71
|
-
// Handle completion logic here
|
|
72
|
-
}, []);
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<StepBasedScreen
|
|
76
|
-
steps={steps}
|
|
77
|
-
stepData={[formData]}
|
|
78
|
-
onComplete={handleComplete}
|
|
79
|
-
showProgressIndicator={true}
|
|
80
|
-
enableAnimations={true}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## 🎛️ API Reference
|
|
87
|
-
|
|
88
|
-
### StepBasedScreen Props
|
|
89
|
-
|
|
90
|
-
| Prop | Type | Default | Description |
|
|
91
|
-
|------|------|---------|-------------|
|
|
92
|
-
| `steps` | `StepConfig[]` | **Required** | Array of step configurations |
|
|
93
|
-
| `stepData` | `any[]` | `[]` | Data to pass to each step |
|
|
94
|
-
| `initialStep` | `number` | `0` | Initial step index |
|
|
95
|
-
| `onComplete` | `(stepData: any[]) => void` | - | Called when all steps are completed |
|
|
96
|
-
| `onStepChange` | `(currentStep: number, totalSteps: number) => void` | - | Called when step changes |
|
|
97
|
-
| `showProgressIndicator` | `boolean` | `true` | Show progress bar/indicator |
|
|
98
|
-
| `enableAnimations` | `boolean` | `true` | Enable step transition animations |
|
|
99
|
-
| `navigate` | `(screen: string, props?: any) => void` | **Required** | Navigation function |
|
|
100
|
-
| `goBack` | `() => void` | - | Go back function |
|
|
101
|
-
| `onAuthenticated` | `(user: any) => void` | - | Authentication callback |
|
|
102
|
-
| `theme` | `string` | **Required** | Theme ('light' or 'dark') |
|
|
103
|
-
|
|
104
|
-
### StepConfig Interface
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
interface StepConfig {
|
|
108
|
-
id: string; // Unique identifier for the step
|
|
109
|
-
component: React.ComponentType<any>; // React component to render
|
|
110
|
-
props?: Record<string, any>; // Additional props for the component
|
|
111
|
-
canProceed?: (stepData?: any) => boolean; // Validation function
|
|
112
|
-
onEnter?: () => void; // Called when entering this step
|
|
113
|
-
onExit?: () => void; // Called when exiting this step
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Step Component Props
|
|
118
|
-
|
|
119
|
-
Each step component receives these props automatically:
|
|
120
|
-
|
|
121
|
-
```typescript
|
|
122
|
-
interface StepComponentProps {
|
|
123
|
-
// Navigation
|
|
124
|
-
nextStep: () => void;
|
|
125
|
-
prevStep: () => void;
|
|
126
|
-
goToStep: (stepIndex: number) => void;
|
|
127
|
-
currentStep: number;
|
|
128
|
-
totalSteps: number;
|
|
129
|
-
|
|
130
|
-
// Data management
|
|
131
|
-
stepData?: any;
|
|
132
|
-
updateStepData: (data: any) => void;
|
|
133
|
-
allStepData: any[];
|
|
134
|
-
|
|
135
|
-
// State
|
|
136
|
-
isTransitioning: boolean;
|
|
137
|
-
|
|
138
|
-
// Common props
|
|
139
|
-
colors: any;
|
|
140
|
-
styles: any;
|
|
141
|
-
theme: string;
|
|
142
|
-
navigate: (screen: string, props?: any) => void;
|
|
143
|
-
goBack: () => void;
|
|
144
|
-
onAuthenticated: (user: any) => void;
|
|
145
|
-
|
|
146
|
-
// Animation refs (advanced usage)
|
|
147
|
-
fadeAnim: Animated.SharedValue<number>;
|
|
148
|
-
slideAnim: Animated.SharedValue<number>;
|
|
149
|
-
scaleAnim: Animated.SharedValue<number>;
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## 📱 Advanced Usage Examples
|
|
154
|
-
|
|
155
|
-
### Conditional Steps
|
|
156
|
-
|
|
157
|
-
```typescript
|
|
158
|
-
const steps: StepConfig[] = [
|
|
159
|
-
{
|
|
160
|
-
id: 'basic-info',
|
|
161
|
-
component: BasicInfoStep,
|
|
162
|
-
canProceed: (data) => data?.name && data?.email,
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
id: 'verification',
|
|
166
|
-
component: VerificationStep,
|
|
167
|
-
canProceed: (data) => data?.verified,
|
|
168
|
-
onEnter: () => {
|
|
169
|
-
// Send verification code
|
|
170
|
-
sendVerificationCode();
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
// Only show if user selected premium
|
|
174
|
-
...(userType === 'premium' ? [{
|
|
175
|
-
id: 'premium-setup',
|
|
176
|
-
component: PremiumSetupStep,
|
|
177
|
-
canProceed: () => true,
|
|
178
|
-
}] : []),
|
|
179
|
-
];
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Async Validation
|
|
183
|
-
|
|
184
|
-
```typescript
|
|
185
|
-
const steps: StepConfig[] = [
|
|
186
|
-
{
|
|
187
|
-
id: 'username',
|
|
188
|
-
component: UsernameStep,
|
|
189
|
-
canProceed: async (data) => {
|
|
190
|
-
if (!data?.username) return false;
|
|
191
|
-
const isAvailable = await checkUsernameAvailability(data.username);
|
|
192
|
-
return isAvailable;
|
|
193
|
-
},
|
|
194
|
-
onEnter: () => {
|
|
195
|
-
// Pre-validate if username exists
|
|
196
|
-
if (existingUsername) {
|
|
197
|
-
validateUsername(existingUsername);
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
];
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Dynamic Step Data
|
|
205
|
-
|
|
206
|
-
```typescript
|
|
207
|
-
const [stepData, setStepData] = useState([
|
|
208
|
-
{ name: '', email: '' }, // Step 1 data
|
|
209
|
-
{ preferences: {} }, // Step 2 data
|
|
210
|
-
{ confirmation: false }, // Step 3 data
|
|
211
|
-
]);
|
|
212
|
-
|
|
213
|
-
// Update specific step data
|
|
214
|
-
const updateStepData = (stepIndex: number, data: any) => {
|
|
215
|
-
setStepData(prev => prev.map((item, index) =>
|
|
216
|
-
index === stepIndex ? { ...item, ...data } : item
|
|
217
|
-
));
|
|
218
|
-
};
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Custom Progress Indicator
|
|
222
|
-
|
|
223
|
-
```typescript
|
|
224
|
-
const CustomProgressIndicator: React.FC<{
|
|
225
|
-
currentStep: number;
|
|
226
|
-
totalSteps: number;
|
|
227
|
-
colors: any;
|
|
228
|
-
}> = ({ currentStep, totalSteps, colors }) => (
|
|
229
|
-
<View style={styles.customProgress}>
|
|
230
|
-
{Array.from({ length: totalSteps }, (_, index) => (
|
|
231
|
-
<View
|
|
232
|
-
key={index}
|
|
233
|
-
style={[
|
|
234
|
-
styles.progressDot,
|
|
235
|
-
{
|
|
236
|
-
backgroundColor: index <= currentStep ? colors.primary : colors.border,
|
|
237
|
-
transform: [{ scale: index === currentStep ? 1.2 : 1 }],
|
|
238
|
-
}
|
|
239
|
-
]}
|
|
240
|
-
/>
|
|
241
|
-
))}
|
|
242
|
-
</View>
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
// Use in your screen component
|
|
246
|
-
<StepBasedScreen
|
|
247
|
-
steps={steps}
|
|
248
|
-
showProgressIndicator={false} // Disable default indicator
|
|
249
|
-
// Add your custom indicator as a step component
|
|
250
|
-
/>
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## 🎨 Styling
|
|
254
|
-
|
|
255
|
-
The component uses your existing theme system and `createAuthStyles`. All styling is consistent with your app's design system.
|
|
256
|
-
|
|
257
|
-
### Customizing Animations
|
|
258
|
-
|
|
259
|
-
```typescript
|
|
260
|
-
// The component includes optimized animations by default
|
|
261
|
-
// For custom animations, access the animation refs in your step components:
|
|
262
|
-
|
|
263
|
-
const MyStepComponent: React.FC<any> = ({
|
|
264
|
-
fadeAnim,
|
|
265
|
-
slideAnim,
|
|
266
|
-
scaleAnim,
|
|
267
|
-
isTransitioning
|
|
268
|
-
}) => {
|
|
269
|
-
const customAnimatedStyle = useAnimatedStyle(() => ({
|
|
270
|
-
opacity: fadeAnim.value,
|
|
271
|
-
transform: [
|
|
272
|
-
{ translateX: slideAnim.value },
|
|
273
|
-
{ scale: scaleAnim.value },
|
|
274
|
-
// Add your custom transforms here
|
|
275
|
-
],
|
|
276
|
-
}));
|
|
277
|
-
|
|
278
|
-
return (
|
|
279
|
-
<Animated.View style={customAnimatedStyle}>
|
|
280
|
-
{/* Your step content */}
|
|
281
|
-
</Animated.View>
|
|
282
|
-
);
|
|
283
|
-
};
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
## 🐛 Troubleshooting
|
|
287
|
-
|
|
288
|
-
### Common Issues
|
|
289
|
-
|
|
290
|
-
1. **Steps not advancing**: Check your `canProceed` functions return `true`
|
|
291
|
-
2. **Animations not working**: Ensure `enableAnimations` is `true` and Reanimated is properly set up
|
|
292
|
-
3. **TypeScript errors**: Make sure your step components accept the `StepComponentProps` interface
|
|
293
|
-
4. **Re-rendering issues**: Use `useCallback` for functions passed to step components
|
|
294
|
-
|
|
295
|
-
### Performance Tips
|
|
296
|
-
|
|
297
|
-
1. **Memoize step components**: Use `React.memo` for step components
|
|
298
|
-
2. **Optimize re-renders**: Only include necessary dependencies in `useMemo` and `useCallback`
|
|
299
|
-
3. **Limit step data**: Keep `stepData` as small as possible
|
|
300
|
-
4. **Use proper keys**: Ensure step components have unique keys for proper reconciliation
|
|
301
|
-
|
|
302
|
-
## 🔄 Migration from Existing Screens
|
|
303
|
-
|
|
304
|
-
### Converting SignInScreen
|
|
305
|
-
|
|
306
|
-
1. Extract step components into separate files
|
|
307
|
-
2. Define step configurations with validation logic
|
|
308
|
-
3. Replace the existing component with `StepBasedScreen`
|
|
309
|
-
4. Pass form state through `stepData`
|
|
310
|
-
|
|
311
|
-
### Converting SignUpScreen
|
|
312
|
-
|
|
313
|
-
1. Break down the 4-step flow into separate components
|
|
314
|
-
2. Implement validation logic in `canProceed` functions
|
|
315
|
-
3. Handle form state management in the parent component
|
|
316
|
-
4. Use `onEnter` and `onExit` for step-specific logic
|
|
317
|
-
|
|
318
|
-
## 📚 Related Components
|
|
319
|
-
|
|
320
|
-
- `TextField` - Input component used in steps
|
|
321
|
-
- `GroupedPillButtons` - Navigation buttons
|
|
322
|
-
- `ProgressIndicator` - Built-in progress component
|
|
323
|
-
- `AnimatedStepContainer` - Animation wrapper
|
|
324
|
-
|
|
325
|
-
## 🤝 Contributing
|
|
326
|
-
|
|
327
|
-
When adding new features to the StepBasedScreen:
|
|
328
|
-
|
|
329
|
-
1. Maintain backward compatibility
|
|
330
|
-
2. Add comprehensive TypeScript types
|
|
331
|
-
3. Include examples in the examples file
|
|
332
|
-
4. Update this documentation
|
|
333
|
-
5. Test with different step configurations
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
**Note**: This component is designed to be highly reusable across different multi-step flows in your application. It handles the common patterns of navigation, animation, and state management, allowing you to focus on the specific logic for each step.
|