@umituz/react-native-onboarding 2.6.10 → 2.7.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/README.md
CHANGED
|
@@ -156,8 +156,11 @@ const slides: OnboardingSlide[] = [
|
|
|
156
156
|
},
|
|
157
157
|
];
|
|
158
158
|
|
|
159
|
+
import Slider from '@react-native-community/slider';
|
|
160
|
+
|
|
159
161
|
<OnboardingScreen
|
|
160
162
|
slides={slides}
|
|
163
|
+
SliderComponent={Slider}
|
|
161
164
|
onComplete={async () => {
|
|
162
165
|
const userData = onboardingStore.getUserData();
|
|
163
166
|
console.log('User answers:', userData.answers);
|
|
@@ -185,6 +188,7 @@ const slides: OnboardingSlide[] = [
|
|
|
185
188
|
| `showProgressText` | `boolean` | `true` | Show progress text (1 of 5) |
|
|
186
189
|
| `storageKey` | `string` | - | Custom storage key for completion state |
|
|
187
190
|
| `autoComplete` | `boolean` | `false` | Auto-complete on last slide |
|
|
191
|
+
| `SliderComponent` | `React.ComponentType` | - | **Required if using slider questions.** Import from `@react-native-community/slider` |
|
|
188
192
|
|
|
189
193
|
### OnboardingSlide Interface
|
|
190
194
|
|
|
@@ -246,6 +250,18 @@ interface OnboardingSlide {
|
|
|
246
250
|
|
|
247
251
|
#### Slider
|
|
248
252
|
|
|
253
|
+
**⚠️ Important:** When using slider questions, you must provide the `SliderComponent` prop to `OnboardingScreen`:
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
import Slider from '@react-native-community/slider';
|
|
257
|
+
|
|
258
|
+
<OnboardingScreen
|
|
259
|
+
slides={slides}
|
|
260
|
+
SliderComponent={Slider}
|
|
261
|
+
onComplete={handleComplete}
|
|
262
|
+
/>
|
|
263
|
+
```
|
|
264
|
+
|
|
249
265
|
```typescript
|
|
250
266
|
{
|
|
251
267
|
type: 'slider',
|
|
@@ -255,6 +271,8 @@ interface OnboardingSlide {
|
|
|
255
271
|
}
|
|
256
272
|
```
|
|
257
273
|
|
|
274
|
+
**Note:** Make sure `@react-native-community/slider` is installed and properly linked (run `pod install` for iOS).
|
|
275
|
+
|
|
258
276
|
#### Rating
|
|
259
277
|
|
|
260
278
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-onboarding",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Advanced onboarding flow for React Native apps with personalization questions, theme-aware colors, animations, and customizable slides. SOLID, DRY, KISS principles applied.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
+
import { View, Text } from "react-native";
|
|
7
8
|
import type { OnboardingQuestion } from "../../domain/entities/OnboardingQuestion";
|
|
8
9
|
import { SingleChoiceQuestion } from "./questions/SingleChoiceQuestion";
|
|
9
10
|
import { MultipleChoiceQuestion } from "./questions/MultipleChoiceQuestion";
|
|
@@ -61,7 +62,18 @@ export const QuestionRenderer: React.FC<QuestionRendererProps> = ({
|
|
|
61
62
|
);
|
|
62
63
|
case "slider":
|
|
63
64
|
if (!SliderComponent) {
|
|
64
|
-
return
|
|
65
|
+
return (
|
|
66
|
+
<View style={{ padding: 20, alignItems: "center" }}>
|
|
67
|
+
<Text style={{ color: "#FFFFFF", textAlign: "center" }}>
|
|
68
|
+
Slider component is not available. Please provide SliderComponent prop
|
|
69
|
+
to OnboardingScreen.
|
|
70
|
+
</Text>
|
|
71
|
+
<Text style={{ color: "#FFFFFF", textAlign: "center", marginTop: 8, fontSize: 12 }}>
|
|
72
|
+
Example: SliderComponent={"Slider"} where {"Slider"} is imported from
|
|
73
|
+
"@react-native-community/slider"
|
|
74
|
+
</Text>
|
|
75
|
+
</View>
|
|
76
|
+
);
|
|
65
77
|
}
|
|
66
78
|
return (
|
|
67
79
|
<SliderQuestion
|