@umituz/react-native-design-system 2.9.53 → 2.9.54
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-design-system",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.54",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { useEffect, useState, useCallback } from "react";
|
|
3
|
-
import { View, Image, StyleSheet
|
|
3
|
+
import { View, Image, StyleSheet } from "react-native";
|
|
4
|
+
import { initialWindowMetrics } from "../../../safe-area";
|
|
4
5
|
import { AtomicText, AtomicSpinner } from "../../../atoms";
|
|
5
6
|
import { useAppDesignTokens } from "../../../theme";
|
|
6
7
|
import type { SplashScreenProps, SplashColors } from "../types";
|
|
@@ -8,14 +9,17 @@ import { SPLASH_CONSTANTS } from "../constants";
|
|
|
8
9
|
|
|
9
10
|
declare const __DEV__: boolean;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Get safe area insets from initial window metrics
|
|
14
|
+
* Used before SafeAreaProvider initializes
|
|
15
|
+
*/
|
|
16
|
+
const getInitialSafeAreaInsets = () => {
|
|
17
|
+
if (initialWindowMetrics?.insets) {
|
|
18
|
+
return initialWindowMetrics.insets;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Fallback to zero insets if no metrics available
|
|
22
|
+
return { top: 0, bottom: 0, left: 0, right: 0 };
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
export const SplashScreen: React.FC<SplashScreenProps> = ({
|
|
@@ -30,6 +34,7 @@ export const SplashScreen: React.FC<SplashScreenProps> = ({
|
|
|
30
34
|
style,
|
|
31
35
|
}: SplashScreenProps) => {
|
|
32
36
|
const tokens = useAppDesignTokens();
|
|
37
|
+
const initialInsets = getInitialSafeAreaInsets();
|
|
33
38
|
const [timedOut, setTimedOut] = useState(false);
|
|
34
39
|
|
|
35
40
|
const handleTimeout = useCallback(() => {
|
|
@@ -77,8 +82,8 @@ export const SplashScreen: React.FC<SplashScreenProps> = ({
|
|
|
77
82
|
const iconPlaceholderColor = colors.iconPlaceholder ?? `${colors.text}30`;
|
|
78
83
|
|
|
79
84
|
const contentStyle = {
|
|
80
|
-
paddingTop:
|
|
81
|
-
paddingBottom:
|
|
85
|
+
paddingTop: initialInsets.top + SPLASH_CONSTANTS.CONTENT_PADDING,
|
|
86
|
+
paddingBottom: initialInsets.bottom + SPLASH_CONSTANTS.CONTENT_PADDING,
|
|
82
87
|
};
|
|
83
88
|
|
|
84
89
|
const content = (
|