@umituz/react-native-design-system 2.6.1 → 2.6.2
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.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, ReactNode } from 'react';
|
|
2
2
|
import { ActivityIndicator, View, StyleSheet } from 'react-native';
|
|
3
|
+
import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
|
|
3
4
|
import { useThemeStore } from '../stores/themeStore';
|
|
4
5
|
import { useDesignSystemTheme } from '../globalThemeStore';
|
|
5
6
|
import type { CustomThemeColors } from '../../core/CustomColors';
|
|
@@ -89,25 +90,33 @@ export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
|
|
|
89
90
|
});
|
|
90
91
|
}, [initialize, customColors, setCustomColors, onInitialized, onError]);
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
const renderContent = () => {
|
|
94
|
+
// Show loading indicator if requested and not yet initialized
|
|
95
|
+
if (showLoadingIndicator && !isInitialized) {
|
|
96
|
+
if (loadingComponent) {
|
|
97
|
+
return <>{loadingComponent}</>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Use SplashScreen if config provided, otherwise fallback to ActivityIndicator
|
|
101
|
+
if (splashConfig?.colors) {
|
|
102
|
+
return <SplashScreen {...splashConfig} />;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<View style={styles.loadingContainer}>
|
|
107
|
+
<ActivityIndicator size="large" />
|
|
108
|
+
</View>
|
|
109
|
+
);
|
|
101
110
|
}
|
|
102
111
|
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
<ActivityIndicator size="large" />
|
|
106
|
-
</View>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
112
|
+
return <>{children}</>;
|
|
113
|
+
};
|
|
109
114
|
|
|
110
|
-
return
|
|
115
|
+
return (
|
|
116
|
+
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
|
|
117
|
+
{renderContent()}
|
|
118
|
+
</SafeAreaProvider>
|
|
119
|
+
);
|
|
111
120
|
};
|
|
112
121
|
|
|
113
122
|
const styles = StyleSheet.create({
|