@umituz/react-native-splash 1.6.2 → 1.6.4

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-splash",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Generic splash screen for React Native apps with animations, gradients, and customizable branding. SOLID, DRY, KISS principles applied.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -66,13 +66,16 @@ export const SplashScreen: React.FC<SplashScreenProps> = ({
66
66
  ? undefined
67
67
  : backgroundColor || tokens.colors.primary;
68
68
 
69
- const finalGradientColors: readonly string[] = gradientColors || [
70
- finalBackgroundColor!,
71
- ];
72
-
73
69
  // Use LinearGradient only if gradientColors provided (length > 1)
74
70
  const hasGradient = gradientColors && gradientColors.length > 1;
75
71
 
72
+ // For LinearGradient, ensure at least 2 colors (tuple type requirement)
73
+ const finalGradientColors: [string, string, ...string[]] = hasGradient
74
+ ? (gradientColors.length >= 2
75
+ ? (gradientColors as [string, string, ...string[]])
76
+ : [gradientColors[0], gradientColors[0] || finalBackgroundColor!])
77
+ : [finalBackgroundColor!, finalBackgroundColor!];
78
+
76
79
  const content = (
77
80
  <>
78
81
  <SplashDecorations />
@@ -111,7 +114,7 @@ export const SplashScreen: React.FC<SplashScreenProps> = ({
111
114
  <View style={styles.container}>
112
115
  {hasGradient ? (
113
116
  <LinearGradient
114
- colors={finalGradientColors as readonly string[]}
117
+ colors={finalGradientColors}
115
118
  start={{ x: 0, y: 0 }}
116
119
  end={{ x: 1, y: 1 }}
117
120
  style={styles.gradient}