@umituz/react-native-onboarding 3.3.8 → 3.3.10
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 +1 -1
- package/src/domain/entities/OnboardingSlide.ts +5 -0
- package/src/presentation/components/BackgroundVideo.tsx +8 -17
- package/src/presentation/components/OnboardingFooter.tsx +69 -112
- package/src/presentation/components/OnboardingHeader.tsx +47 -72
- package/src/presentation/components/OnboardingResetSetting.tsx +17 -51
- package/src/presentation/components/OnboardingScreenContent.tsx +2 -2
- package/src/presentation/components/OnboardingSlide.tsx +81 -71
- package/src/presentation/components/QuestionRenderer.tsx +2 -2
- package/src/presentation/components/QuestionSlide.tsx +42 -46
- package/src/presentation/components/QuestionSlideHeader.tsx +52 -67
- package/src/presentation/components/questions/MultipleChoiceQuestion.tsx +26 -55
- package/src/presentation/components/questions/RatingQuestion.tsx +24 -45
- package/src/presentation/components/questions/SingleChoiceQuestion.tsx +23 -49
- package/src/presentation/components/questions/TextInputQuestion.tsx +15 -20
- package/src/presentation/providers/OnboardingThemeProvider.tsx +98 -0
- package/src/presentation/screens/OnboardingScreen.tsx +34 -31
- package/src/presentation/styles/OnboardingSlideStyles.ts +0 -139
- package/src/presentation/styles/QuestionSlideStyles.ts +0 -78
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-onboarding",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.10",
|
|
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",
|
|
@@ -41,6 +41,11 @@ export interface OnboardingSlide {
|
|
|
41
41
|
*/
|
|
42
42
|
icon: string;
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Type of icon: 'emoji' or 'icon' (default: 'icon')
|
|
46
|
+
*/
|
|
47
|
+
iconType?: 'emoji' | 'icon';
|
|
48
|
+
|
|
44
49
|
/**
|
|
45
50
|
* Gradient colors for the slide background (optional)
|
|
46
51
|
* [startColor, endColor] or [color1, color2, color3] for multi-stop gradients
|
|
@@ -7,27 +7,18 @@ interface BackgroundVideoProps {
|
|
|
7
7
|
overlayOpacity?: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const BackgroundVideo
|
|
11
|
-
const player = useVideoPlayer(source,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export const BackgroundVideo = ({ source, overlayOpacity = 0.5 }: BackgroundVideoProps) => {
|
|
11
|
+
const player = useVideoPlayer(source, (p) => {
|
|
12
|
+
p.loop = true;
|
|
13
|
+
p.play();
|
|
14
|
+
p.muted = true;
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<View style={StyleSheet.absoluteFill}>
|
|
19
|
-
<VideoView
|
|
20
|
-
|
|
21
|
-
style={StyleSheet.absoluteFill}
|
|
22
|
-
contentFit="cover"
|
|
23
|
-
nativeControls={false}
|
|
24
|
-
/>
|
|
25
|
-
<View
|
|
26
|
-
style={[
|
|
27
|
-
StyleSheet.absoluteFill,
|
|
28
|
-
{ backgroundColor: `rgba(0,0,0,${overlayOpacity})` }
|
|
29
|
-
]}
|
|
30
|
-
/>
|
|
19
|
+
<VideoView player={player} style={StyleSheet.absoluteFill} contentFit="cover" nativeControls={false} />
|
|
20
|
+
<View style={[StyleSheet.absoluteFill, { backgroundColor: `rgba(0,0,0,${overlayOpacity})` }]} />
|
|
31
21
|
</View>
|
|
32
22
|
);
|
|
33
23
|
};
|
|
24
|
+
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Displays progress bar, dots, and next/get started button
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useMemo } from "react";
|
|
8
|
-
import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
9
3
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
4
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
11
|
-
import {
|
|
5
|
+
import { AtomicButton, AtomicText } from "@umituz/react-native-design-system";
|
|
6
|
+
import { useOnboardingTheme } from "../providers/OnboardingThemeProvider";
|
|
12
7
|
|
|
13
8
|
export interface OnboardingFooterProps {
|
|
14
9
|
currentIndex: number;
|
|
@@ -21,10 +16,9 @@ export interface OnboardingFooterProps {
|
|
|
21
16
|
nextButtonText?: string;
|
|
22
17
|
getStartedButtonText?: string;
|
|
23
18
|
disabled?: boolean;
|
|
24
|
-
useGradient?: boolean;
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
export const OnboardingFooter
|
|
21
|
+
export const OnboardingFooter = ({
|
|
28
22
|
currentIndex,
|
|
29
23
|
totalSlides,
|
|
30
24
|
isLastSlide,
|
|
@@ -35,28 +29,23 @@ export const OnboardingFooter: React.FC<OnboardingFooterProps> = ({
|
|
|
35
29
|
nextButtonText,
|
|
36
30
|
getStartedButtonText,
|
|
37
31
|
disabled = false,
|
|
38
|
-
|
|
39
|
-
}) => {
|
|
32
|
+
}: OnboardingFooterProps) => {
|
|
40
33
|
const insets = useSafeAreaInsets();
|
|
41
34
|
const { t } = useLocalization();
|
|
42
|
-
const
|
|
43
|
-
const styles = useMemo(() => getStyles(insets, tokens, useGradient), [insets, tokens, useGradient]);
|
|
35
|
+
const { colors } = useOnboardingTheme();
|
|
44
36
|
|
|
45
37
|
const buttonText = isLastSlide
|
|
46
|
-
? getStartedButtonText || t("onboarding.getStarted")
|
|
47
|
-
: nextButtonText || t("general.continue");
|
|
38
|
+
? getStartedButtonText || t("onboarding.getStarted") || "Get Started"
|
|
39
|
+
: nextButtonText || t("general.continue") || "Continue";
|
|
40
|
+
|
|
41
|
+
const progressPercent = ((currentIndex + 1) / totalSlides) * 100;
|
|
48
42
|
|
|
49
43
|
return (
|
|
50
|
-
<View style={styles.footer}>
|
|
44
|
+
<View style={[styles.footer, { paddingBottom: insets.bottom + 24 }]}>
|
|
51
45
|
{showProgressBar && (
|
|
52
46
|
<View style={styles.progressContainer}>
|
|
53
|
-
<View style={styles.progressBar}>
|
|
54
|
-
<View
|
|
55
|
-
style={[
|
|
56
|
-
styles.progressFill,
|
|
57
|
-
{ width: `${((currentIndex + 1) / totalSlides) * 100}%` },
|
|
58
|
-
]}
|
|
59
|
-
/>
|
|
47
|
+
<View style={[styles.progressBar, { backgroundColor: colors.progressBarBg }]}>
|
|
48
|
+
<View style={[styles.progressFill, { width: `${progressPercent}%`, backgroundColor: colors.progressFillColor }]} />
|
|
60
49
|
</View>
|
|
61
50
|
</View>
|
|
62
51
|
)}
|
|
@@ -66,106 +55,74 @@ export const OnboardingFooter: React.FC<OnboardingFooterProps> = ({
|
|
|
66
55
|
{Array.from({ length: totalSlides }).map((_, index) => (
|
|
67
56
|
<View
|
|
68
57
|
key={index}
|
|
69
|
-
style={[
|
|
58
|
+
style={[
|
|
59
|
+
styles.dot,
|
|
60
|
+
{ backgroundColor: colors.dotColor },
|
|
61
|
+
index === currentIndex && {
|
|
62
|
+
width: 12,
|
|
63
|
+
backgroundColor: colors.activeDotColor
|
|
64
|
+
}
|
|
65
|
+
]}
|
|
70
66
|
/>
|
|
71
67
|
))}
|
|
72
68
|
</View>
|
|
73
69
|
)}
|
|
74
70
|
|
|
75
|
-
<
|
|
76
|
-
style={[styles.button, disabled && styles.buttonDisabled]}
|
|
71
|
+
<AtomicButton
|
|
77
72
|
onPress={onNext}
|
|
78
73
|
disabled={disabled}
|
|
79
|
-
|
|
74
|
+
fullWidth
|
|
75
|
+
variant="primary"
|
|
76
|
+
style={{ backgroundColor: colors.buttonBg }}
|
|
77
|
+
textStyle={{ color: colors.buttonTextColor }}
|
|
80
78
|
>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</Text>
|
|
84
|
-
</TouchableOpacity>
|
|
79
|
+
{buttonText}
|
|
80
|
+
</AtomicButton>
|
|
85
81
|
|
|
86
82
|
{showProgressText && (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
<AtomicText
|
|
84
|
+
type="labelSmall"
|
|
85
|
+
style={[styles.progressText, { color: colors.progressTextColor }]}
|
|
86
|
+
>
|
|
87
|
+
{currentIndex + 1} {t("general.of") || "of"} {totalSlides}
|
|
88
|
+
</AtomicText>
|
|
90
89
|
)}
|
|
91
90
|
</View>
|
|
92
91
|
);
|
|
93
92
|
};
|
|
94
93
|
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
width: 6,
|
|
130
|
-
height: 6,
|
|
131
|
-
borderRadius: 3,
|
|
132
|
-
backgroundColor: useGradient
|
|
133
|
-
? "rgba(255, 255, 255, 0.4)"
|
|
134
|
-
: tokens.colors.borderLight,
|
|
135
|
-
},
|
|
136
|
-
dotActive: {
|
|
137
|
-
width: 8,
|
|
138
|
-
backgroundColor: useGradient ? tokens.colors.surface : tokens.colors.primary,
|
|
139
|
-
},
|
|
140
|
-
button: {
|
|
141
|
-
backgroundColor: useGradient ? tokens.colors.surface : tokens.colors.primary,
|
|
142
|
-
paddingVertical: 16,
|
|
143
|
-
borderRadius: 28,
|
|
144
|
-
alignItems: "center",
|
|
145
|
-
marginBottom: 12,
|
|
146
|
-
},
|
|
147
|
-
buttonDisabled: {
|
|
148
|
-
backgroundColor: useGradient
|
|
149
|
-
? "rgba(255, 255, 255, 0.4)"
|
|
150
|
-
: tokens.colors.borderLight,
|
|
151
|
-
opacity: 0.5,
|
|
152
|
-
},
|
|
153
|
-
buttonText: {
|
|
154
|
-
color: useGradient ? tokens.colors.primary : tokens.colors.surface,
|
|
155
|
-
fontSize: 16,
|
|
156
|
-
fontWeight: "bold",
|
|
157
|
-
},
|
|
158
|
-
buttonTextDisabled: {
|
|
159
|
-
color: useGradient
|
|
160
|
-
? "rgba(255, 255, 255, 0.6)"
|
|
161
|
-
: tokens.colors.textSecondary,
|
|
162
|
-
},
|
|
163
|
-
progressText: {
|
|
164
|
-
color: useGradient
|
|
165
|
-
? "rgba(255, 255, 255, 0.75)"
|
|
166
|
-
: tokens.colors.textSecondary,
|
|
167
|
-
fontSize: 12,
|
|
168
|
-
textAlign: "center",
|
|
169
|
-
},
|
|
170
|
-
});
|
|
94
|
+
const styles = StyleSheet.create({
|
|
95
|
+
footer: {
|
|
96
|
+
paddingHorizontal: 24,
|
|
97
|
+
paddingTop: 24,
|
|
98
|
+
},
|
|
99
|
+
progressContainer: {
|
|
100
|
+
marginBottom: 20,
|
|
101
|
+
},
|
|
102
|
+
progressBar: {
|
|
103
|
+
height: 4,
|
|
104
|
+
borderRadius: 2,
|
|
105
|
+
overflow: "hidden",
|
|
106
|
+
},
|
|
107
|
+
progressFill: {
|
|
108
|
+
height: "100%",
|
|
109
|
+
borderRadius: 2,
|
|
110
|
+
},
|
|
111
|
+
dots: {
|
|
112
|
+
flexDirection: "row",
|
|
113
|
+
justifyContent: "center",
|
|
114
|
+
marginBottom: 24,
|
|
115
|
+
gap: 8,
|
|
116
|
+
},
|
|
117
|
+
dot: {
|
|
118
|
+
width: 6,
|
|
119
|
+
height: 6,
|
|
120
|
+
borderRadius: 3,
|
|
121
|
+
},
|
|
122
|
+
progressText: {
|
|
123
|
+
marginTop: 12,
|
|
124
|
+
textAlign: "center",
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
|
|
171
128
|
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Displays back and skip buttons
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useMemo } from "react";
|
|
8
|
-
import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
|
|
9
|
-
import { AtomicIcon } from "@umituz/react-native-design-system";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { AtomicIcon, AtomicText } from "@umituz/react-native-design-system";
|
|
10
4
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
11
|
-
import {
|
|
5
|
+
import { useOnboardingTheme } from "../providers/OnboardingThemeProvider";
|
|
12
6
|
|
|
13
7
|
export interface OnboardingHeaderProps {
|
|
14
8
|
isFirstSlide: boolean;
|
|
@@ -17,99 +11,80 @@ export interface OnboardingHeaderProps {
|
|
|
17
11
|
showBackButton?: boolean;
|
|
18
12
|
showSkipButton?: boolean;
|
|
19
13
|
skipButtonText?: string;
|
|
20
|
-
useGradient?: boolean;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
export const OnboardingHeader
|
|
16
|
+
export const OnboardingHeader = ({
|
|
24
17
|
isFirstSlide,
|
|
25
18
|
onBack,
|
|
26
19
|
onSkip,
|
|
27
20
|
showBackButton = true,
|
|
28
21
|
showSkipButton = true,
|
|
29
22
|
skipButtonText,
|
|
30
|
-
|
|
31
|
-
}) => {
|
|
23
|
+
}: OnboardingHeaderProps) => {
|
|
32
24
|
const { t } = useLocalization();
|
|
33
|
-
const
|
|
34
|
-
const styles = useMemo(() => getStyles(tokens, useGradient), [tokens, useGradient]);
|
|
35
|
-
|
|
36
|
-
const skipText = skipButtonText || t("onboarding.skip");
|
|
25
|
+
const { colors } = useOnboardingTheme();
|
|
37
26
|
|
|
38
|
-
const
|
|
39
|
-
/* eslint-disable-next-line no-console */
|
|
40
|
-
if (__DEV__) {
|
|
41
|
-
console.log("[OnboardingHeader] Back pressed, isFirstSlide:", isFirstSlide);
|
|
42
|
-
}
|
|
43
|
-
if (!isFirstSlide && onBack) {
|
|
44
|
-
onBack();
|
|
45
|
-
}
|
|
46
|
-
};
|
|
27
|
+
const skipText = skipButtonText || t("onboarding.skip") || "Skip";
|
|
47
28
|
|
|
48
29
|
return (
|
|
49
30
|
<View style={styles.header}>
|
|
50
31
|
{showBackButton ? (
|
|
51
32
|
<TouchableOpacity
|
|
52
|
-
onPress={
|
|
33
|
+
onPress={() => !isFirstSlide && onBack?.()}
|
|
53
34
|
disabled={isFirstSlide}
|
|
54
35
|
style={[
|
|
55
36
|
styles.headerButton,
|
|
37
|
+
{
|
|
38
|
+
backgroundColor: colors.headerButtonBg,
|
|
39
|
+
borderColor: colors.headerButtonBorder,
|
|
40
|
+
},
|
|
56
41
|
isFirstSlide && styles.headerButtonDisabled,
|
|
57
42
|
]}
|
|
58
43
|
activeOpacity={0.7}
|
|
59
44
|
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
60
45
|
>
|
|
61
|
-
<AtomicIcon
|
|
62
|
-
name="chevron-back"
|
|
63
|
-
customSize={20}
|
|
64
|
-
customColor={useGradient ? tokens.colors.surface : tokens.colors.textPrimary}
|
|
65
|
-
/>
|
|
46
|
+
<AtomicIcon name="chevron-back" customSize={20} customColor={colors.iconColor} />
|
|
66
47
|
</TouchableOpacity>
|
|
67
48
|
) : (
|
|
68
49
|
<View style={styles.headerButton} />
|
|
69
50
|
)}
|
|
70
|
-
{showSkipButton
|
|
51
|
+
{showSkipButton ? (
|
|
71
52
|
<TouchableOpacity onPress={onSkip} activeOpacity={0.7}>
|
|
72
|
-
<
|
|
53
|
+
<AtomicText
|
|
54
|
+
type="labelLarge"
|
|
55
|
+
style={[styles.skipText, { color: colors.textColor }]}
|
|
56
|
+
>
|
|
57
|
+
{skipText}
|
|
58
|
+
</AtomicText>
|
|
73
59
|
</TouchableOpacity>
|
|
74
|
-
)}
|
|
60
|
+
) : <View />}
|
|
75
61
|
</View>
|
|
76
62
|
);
|
|
77
63
|
};
|
|
78
64
|
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
: tokens.colors.borderLight,
|
|
105
|
-
},
|
|
106
|
-
headerButtonDisabled: {
|
|
107
|
-
opacity: 0.3,
|
|
108
|
-
},
|
|
109
|
-
skipText: {
|
|
110
|
-
color: useGradient ? tokens.colors.surface : tokens.colors.textPrimary,
|
|
111
|
-
fontSize: 16,
|
|
112
|
-
fontWeight: "600",
|
|
113
|
-
},
|
|
114
|
-
});
|
|
65
|
+
const styles = StyleSheet.create({
|
|
66
|
+
header: {
|
|
67
|
+
flexDirection: "row",
|
|
68
|
+
justifyContent: "space-between",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
paddingHorizontal: 20,
|
|
71
|
+
paddingTop: 10,
|
|
72
|
+
paddingBottom: 20,
|
|
73
|
+
},
|
|
74
|
+
headerButton: {
|
|
75
|
+
width: 40,
|
|
76
|
+
height: 40,
|
|
77
|
+
borderRadius: 20,
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
borderWidth: 1,
|
|
81
|
+
},
|
|
82
|
+
headerButtonDisabled: {
|
|
83
|
+
opacity: 0,
|
|
84
|
+
},
|
|
85
|
+
skipText: {
|
|
86
|
+
fontWeight: "700",
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
115
90
|
|
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Onboarding Reset Setting Component
|
|
3
|
-
* Single Responsibility: Provide onboarding reset functionality for settings screens
|
|
4
|
-
* Generic component for hundreds of apps
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useCallback } from "react";
|
|
8
|
-
import { View,
|
|
9
|
-
import { AtomicIcon } from "@umituz/react-native-design-system";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { AtomicIcon, AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
4
|
|
|
12
5
|
export interface OnboardingResetSettingProps {
|
|
13
|
-
/** Callback when reset is triggered */
|
|
14
6
|
onReset: () => void | Promise<void>;
|
|
15
|
-
/** Title text to display */
|
|
16
7
|
title?: string;
|
|
17
|
-
/** Description text to display */
|
|
18
8
|
description?: string;
|
|
19
|
-
/** Custom icon name */
|
|
20
9
|
iconName?: string;
|
|
21
|
-
/** Custom icon color */
|
|
22
10
|
iconColor?: string;
|
|
23
|
-
/** Custom title color */
|
|
24
11
|
titleColor?: string;
|
|
25
|
-
/** Whether to show this setting (default: only in __DEV__) */
|
|
26
12
|
visible?: boolean;
|
|
27
|
-
/** Is last item in list */
|
|
28
13
|
isLast?: boolean;
|
|
29
14
|
}
|
|
30
15
|
|
|
31
|
-
export const OnboardingResetSetting
|
|
16
|
+
export const OnboardingResetSetting = ({
|
|
32
17
|
onReset,
|
|
33
18
|
title = "Reset Onboarding",
|
|
34
19
|
description = "Show onboarding flow again",
|
|
@@ -37,43 +22,31 @@ export const OnboardingResetSetting: React.FC<OnboardingResetSettingProps> = ({
|
|
|
37
22
|
titleColor,
|
|
38
23
|
visible = __DEV__,
|
|
39
24
|
isLast = false,
|
|
40
|
-
}) => {
|
|
25
|
+
}: OnboardingResetSettingProps) => {
|
|
41
26
|
const tokens = useAppDesignTokens();
|
|
42
27
|
|
|
43
28
|
const handlePress = useCallback(async () => {
|
|
44
29
|
await onReset();
|
|
45
30
|
}, [onReset]);
|
|
46
31
|
|
|
47
|
-
if (!visible)
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
32
|
+
if (!visible) return null;
|
|
50
33
|
|
|
51
|
-
const defaultIconColor = iconColor || tokens.colors.
|
|
52
|
-
const defaultTitleColor = titleColor || tokens.colors.
|
|
34
|
+
const defaultIconColor = iconColor || tokens.colors.error;
|
|
35
|
+
const defaultTitleColor = titleColor || tokens.colors.error;
|
|
53
36
|
|
|
54
37
|
return (
|
|
55
38
|
<TouchableOpacity onPress={handlePress} activeOpacity={0.7}>
|
|
56
39
|
<View style={[styles.container, !isLast && { borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: tokens.colors.border }]}>
|
|
57
40
|
<View style={styles.iconContainer}>
|
|
58
|
-
<AtomicIcon
|
|
59
|
-
name={iconName}
|
|
60
|
-
size="md"
|
|
61
|
-
customColor={defaultIconColor}
|
|
62
|
-
/>
|
|
41
|
+
<AtomicIcon name={iconName} size="md" customColor={defaultIconColor} />
|
|
63
42
|
</View>
|
|
64
43
|
<View style={styles.content}>
|
|
65
|
-
<
|
|
66
|
-
style={[styles.title, { color: defaultTitleColor }]}
|
|
67
|
-
numberOfLines={1}
|
|
68
|
-
>
|
|
44
|
+
<AtomicText type="bodyLarge" style={{ color: defaultTitleColor, fontWeight: '600' }} numberOfLines={1}>
|
|
69
45
|
{title}
|
|
70
|
-
</
|
|
71
|
-
<
|
|
72
|
-
style={[styles.description, { color: tokens.colors.textSecondary }]}
|
|
73
|
-
numberOfLines={1}
|
|
74
|
-
>
|
|
46
|
+
</AtomicText>
|
|
47
|
+
<AtomicText type="bodyMedium" style={{ color: tokens.colors.textSecondary }} numberOfLines={1}>
|
|
75
48
|
{description}
|
|
76
|
-
</
|
|
49
|
+
</AtomicText>
|
|
77
50
|
</View>
|
|
78
51
|
</View>
|
|
79
52
|
</TouchableOpacity>
|
|
@@ -84,21 +57,14 @@ const styles = StyleSheet.create({
|
|
|
84
57
|
container: {
|
|
85
58
|
flexDirection: "row",
|
|
86
59
|
alignItems: "center",
|
|
87
|
-
paddingVertical:
|
|
88
|
-
paddingHorizontal:
|
|
60
|
+
paddingVertical: 16,
|
|
61
|
+
paddingHorizontal: 20,
|
|
89
62
|
},
|
|
90
63
|
iconContainer: {
|
|
91
|
-
marginRight:
|
|
64
|
+
marginRight: 16,
|
|
92
65
|
},
|
|
93
66
|
content: {
|
|
94
67
|
flex: 1,
|
|
95
|
-
}
|
|
96
|
-
title: {
|
|
97
|
-
fontSize: 16,
|
|
98
|
-
fontWeight: "500",
|
|
99
|
-
},
|
|
100
|
-
description: {
|
|
101
|
-
fontSize: 14,
|
|
102
|
-
marginTop: 2,
|
|
103
|
-
},
|
|
68
|
+
}
|
|
104
69
|
});
|
|
70
|
+
|
|
@@ -56,7 +56,7 @@ export interface OnboardingScreenContentProps {
|
|
|
56
56
|
variant?: "default" | "card" | "minimal" | "fullscreen";
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export const OnboardingScreenContent
|
|
59
|
+
export const OnboardingScreenContent = ({
|
|
60
60
|
containerStyle,
|
|
61
61
|
useGradient,
|
|
62
62
|
currentSlide,
|
|
@@ -84,7 +84,7 @@ export const OnboardingScreenContent: React.FC<OnboardingScreenContentProps> = (
|
|
|
84
84
|
onUpgrade,
|
|
85
85
|
showPaywallOnComplete,
|
|
86
86
|
variant = "default",
|
|
87
|
-
}) => {
|
|
87
|
+
}: OnboardingScreenContentProps) => {
|
|
88
88
|
const { themeMode } = useTheme();
|
|
89
89
|
|
|
90
90
|
const hasMedia = !!currentSlide?.backgroundImage || !!currentSlide?.backgroundVideo;
|