@umituz/react-native-onboarding 2.6.1 → 2.6.3

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.6.1",
3
+ "version": "2.6.3",
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",
@@ -85,5 +85,11 @@ export interface OnboardingOptions {
85
85
  * Show paywall modal on onboarding completion (default: false)
86
86
  */
87
87
  showPaywallOnComplete?: boolean;
88
+
89
+ /**
90
+ * Use gradient background for all slides (default: false)
91
+ * When true, all slides will use gradient backgrounds if available
92
+ */
93
+ useGradient?: boolean;
88
94
  }
89
95
 
@@ -10,13 +10,23 @@ import type { OnboardingSlide } from "../../domain/entities/OnboardingSlide";
10
10
  /**
11
11
  * Check if slide should use gradient background
12
12
  * @param slide - The slide to check
13
+ * @param globalUseGradient - Global useGradient option from OnboardingOptions
13
14
  * @returns true if gradient should be used, false otherwise
14
15
  */
15
- export function shouldUseGradient(slide: OnboardingSlide | undefined): boolean {
16
+ export function shouldUseGradient(
17
+ slide: OnboardingSlide | undefined,
18
+ globalUseGradient?: boolean
19
+ ): boolean {
16
20
  if (!slide) {
17
21
  return false;
18
22
  }
19
23
 
24
+ // If global useGradient is true, use gradient if slide has gradient defined
25
+ if (globalUseGradient === true) {
26
+ return slide.gradient !== undefined && slide.gradient.length > 0;
27
+ }
28
+
29
+ // Otherwise, check slide's own useGradient prop
20
30
  return (
21
31
  slide.useGradient === true &&
22
32
  slide.gradient !== undefined &&
@@ -138,10 +138,8 @@ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>, useGradient: b
138
138
  alignItems: "center",
139
139
  maxWidth: 500,
140
140
  width: "100%",
141
- // Gradient kullanıldığında yarı şeffaf, değilse solid
142
- backgroundColor: useGradient
143
- ? "rgba(255, 255, 255, 0.15)"
144
- : tokens.colors.surface,
141
+ // Gradient kullanıldığında tamamen şeffaf, değilse solid
142
+ backgroundColor: useGradient ? "transparent" : tokens.colors.surface,
145
143
  padding: 30,
146
144
  borderRadius: 24,
147
145
  borderWidth: useGradient ? 0 : 1,
@@ -151,13 +149,9 @@ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>, useGradient: b
151
149
  width: 0,
152
150
  height: 4,
153
151
  },
154
- shadowOpacity: useGradient ? 0.3 : 0.1,
152
+ shadowOpacity: useGradient ? 0 : 0.1,
155
153
  shadowRadius: 8,
156
- elevation: 4,
157
- // Gradient için backdrop blur efekti
158
- ...(useGradient && {
159
- backdropFilter: "blur(10px)",
160
- }),
154
+ elevation: useGradient ? 0 : 4,
161
155
  },
162
156
  iconContainer: {
163
157
  width: 96,
@@ -88,6 +88,7 @@ export const OnboardingScreen: React.FC<OnboardingScreenProps> = ({
88
88
  renderSlide,
89
89
  onUpgrade,
90
90
  showPaywallOnComplete = false,
91
+ useGradient: globalUseGradient = false,
91
92
  }) => {
92
93
  const insets = useSafeAreaInsets();
93
94
  const tokens = useAppDesignTokens();
@@ -175,7 +176,7 @@ export const OnboardingScreen: React.FC<OnboardingScreenProps> = ({
175
176
  };
176
177
 
177
178
  // Check if gradient should be used
178
- const useGradient = shouldUseGradient(currentSlide);
179
+ const useGradient = shouldUseGradient(currentSlide, globalUseGradient);
179
180
 
180
181
  // Validate answer using service
181
182
  const isAnswerValid = useMemo(() => {