@umituz/react-native-onboarding 2.6.11 → 2.7.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-onboarding",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
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",
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { useMemo } from "react";
|
|
8
8
|
import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
|
|
9
|
+
import { ArrowLeft } from "lucide-react-native";
|
|
9
10
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
10
11
|
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
12
|
|
|
@@ -34,24 +35,34 @@ export const OnboardingHeader: React.FC<OnboardingHeaderProps> = ({
|
|
|
34
35
|
|
|
35
36
|
const skipText = skipButtonText || t("onboarding.skip", "Skip");
|
|
36
37
|
|
|
38
|
+
const handleBackPress = () => {
|
|
39
|
+
if (!isFirstSlide) {
|
|
40
|
+
onBack();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
return (
|
|
38
45
|
<View style={styles.header}>
|
|
39
46
|
{showBackButton ? (
|
|
40
47
|
<TouchableOpacity
|
|
41
|
-
onPress={
|
|
48
|
+
onPress={handleBackPress}
|
|
42
49
|
disabled={isFirstSlide}
|
|
43
50
|
style={[
|
|
44
51
|
styles.headerButton,
|
|
45
52
|
isFirstSlide && styles.headerButtonDisabled,
|
|
46
53
|
]}
|
|
54
|
+
activeOpacity={0.7}
|
|
47
55
|
>
|
|
48
|
-
<
|
|
56
|
+
<ArrowLeft
|
|
57
|
+
size={20}
|
|
58
|
+
color={useGradient ? "#FFFFFF" : tokens.colors.textPrimary}
|
|
59
|
+
/>
|
|
49
60
|
</TouchableOpacity>
|
|
50
61
|
) : (
|
|
51
62
|
<View style={styles.headerButton} />
|
|
52
63
|
)}
|
|
53
64
|
{showSkipButton && (
|
|
54
|
-
<TouchableOpacity onPress={onSkip}>
|
|
65
|
+
<TouchableOpacity onPress={onSkip} activeOpacity={0.7}>
|
|
55
66
|
<Text style={styles.skipText}>{skipText}</Text>
|
|
56
67
|
</TouchableOpacity>
|
|
57
68
|
)}
|
|
@@ -89,11 +100,6 @@ const getStyles = (
|
|
|
89
100
|
headerButtonDisabled: {
|
|
90
101
|
opacity: 0.3,
|
|
91
102
|
},
|
|
92
|
-
headerButtonText: {
|
|
93
|
-
color: useGradient ? "#FFFFFF" : tokens.colors.textPrimary,
|
|
94
|
-
fontSize: 20,
|
|
95
|
-
fontWeight: "bold",
|
|
96
|
-
},
|
|
97
103
|
skipText: {
|
|
98
104
|
color: useGradient ? "#FFFFFF" : tokens.colors.textPrimary,
|
|
99
105
|
fontSize: 16,
|
|
@@ -62,7 +62,6 @@ export const QuestionRenderer: React.FC<QuestionRendererProps> = ({
|
|
|
62
62
|
);
|
|
63
63
|
case "slider":
|
|
64
64
|
if (!SliderComponent) {
|
|
65
|
-
// Show helpful error message if SliderComponent is not provided
|
|
66
65
|
return (
|
|
67
66
|
<View style={{ padding: 20, alignItems: "center" }}>
|
|
68
67
|
<Text style={{ color: "#FFFFFF", textAlign: "center" }}>
|
|
@@ -70,7 +69,7 @@ export const QuestionRenderer: React.FC<QuestionRendererProps> = ({
|
|
|
70
69
|
to OnboardingScreen.
|
|
71
70
|
</Text>
|
|
72
71
|
<Text style={{ color: "#FFFFFF", textAlign: "center", marginTop: 8, fontSize: 12 }}>
|
|
73
|
-
Example: SliderComponent={Slider} where Slider is imported from
|
|
72
|
+
Example: SliderComponent={"Slider"} where {"Slider"} is imported from
|
|
74
73
|
"@react-native-community/slider"
|
|
75
74
|
</Text>
|
|
76
75
|
</View>
|