@umituz/react-native-splash 1.0.2 → 1.0.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.0.
|
|
3
|
+
"version": "1.0.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",
|
|
@@ -45,6 +45,12 @@ export const SplashScreen: React.FC<SplashScreenProps> = ({
|
|
|
45
45
|
const responsive = useResponsive();
|
|
46
46
|
const insets = useSafeAreaInsets();
|
|
47
47
|
const { t } = useLocalization();
|
|
48
|
+
|
|
49
|
+
// Safety check: Don't render if tokens or responsive are not ready
|
|
50
|
+
if (!tokens || !responsive || !tokens.spacing || !responsive.horizontalPadding) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
48
54
|
const styles = useMemo(
|
|
49
55
|
() => getStyles(tokens, responsive, insets, backgroundColor, gradientColors),
|
|
50
56
|
[tokens, responsive, insets, backgroundColor, gradientColors],
|
|
@@ -215,8 +221,29 @@ const getStyles = (
|
|
|
215
221
|
insets: { top: number; bottom: number },
|
|
216
222
|
backgroundColor?: string,
|
|
217
223
|
gradientColors?: string[],
|
|
218
|
-
) =>
|
|
219
|
-
|
|
224
|
+
) => {
|
|
225
|
+
// Safety check: Return empty styles if tokens or responsive are not ready
|
|
226
|
+
if (!tokens || !responsive || !tokens.spacing || !tokens.colors || !responsive.horizontalPadding) {
|
|
227
|
+
return StyleSheet.create({
|
|
228
|
+
container: { flex: 1 },
|
|
229
|
+
backgroundGradient: {},
|
|
230
|
+
content: {},
|
|
231
|
+
logoContainer: {},
|
|
232
|
+
logoBackground: {},
|
|
233
|
+
textContainer: {},
|
|
234
|
+
appName: {},
|
|
235
|
+
tagline: {},
|
|
236
|
+
loadingContainer: {},
|
|
237
|
+
loadingBar: {},
|
|
238
|
+
loadingProgress: {},
|
|
239
|
+
loadingText: {},
|
|
240
|
+
footer: {},
|
|
241
|
+
footerText: {},
|
|
242
|
+
versionText: {},
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return StyleSheet.create({
|
|
220
247
|
container: {
|
|
221
248
|
flex: 1,
|
|
222
249
|
backgroundColor: backgroundColor || tokens.colors.primary,
|
|
@@ -319,4 +346,5 @@ const getStyles = (
|
|
|
319
346
|
fontSize: responsive.getFontSize(STATIC_TOKENS.typography.caption.fontSize ?? 12),
|
|
320
347
|
},
|
|
321
348
|
});
|
|
349
|
+
};
|
|
322
350
|
|