@umituz/react-native-settings 5.3.53 → 5.3.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-settings",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.54",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -2,16 +2,18 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import type { StackScreen } from "@umituz/react-native-design-system/molecules";
|
|
3
3
|
import { LanguageSelectionScreen } from "../../../domains/localization";
|
|
4
4
|
import { NotificationSettingsScreen } from "../../../domains/notifications";
|
|
5
|
+
import { SettingsScreen } from "../../screens/SettingsScreen";
|
|
6
|
+
|
|
5
7
|
// AccountScreen is an optional peer — lazy require so the package works without @umituz/react-native-auth
|
|
6
|
-
|
|
8
|
+
// Returns null if @umituz/react-native-auth is not installed
|
|
9
|
+
const getAccountScreen = (): React.ComponentType<any> | null => {
|
|
7
10
|
try {
|
|
8
11
|
return require("@umituz/react-native-auth").AccountScreen ?? null;
|
|
9
|
-
} catch
|
|
10
|
-
|
|
12
|
+
} catch {
|
|
13
|
+
// Auth package not available, silently return null
|
|
11
14
|
return null;
|
|
12
15
|
}
|
|
13
|
-
}
|
|
14
|
-
import { SettingsScreen } from "../../screens/SettingsScreen";
|
|
16
|
+
};
|
|
15
17
|
import { AppearanceScreen } from "../../screens/AppearanceScreen";
|
|
16
18
|
import { FAQScreen } from "../../../domains/faqs";
|
|
17
19
|
import { AboutScreen } from "../../../domains/about";
|
|
@@ -132,8 +134,11 @@ export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[
|
|
|
132
134
|
});
|
|
133
135
|
|
|
134
136
|
const accountScreen = createConditionalScreen(
|
|
135
|
-
!!accountConfig && !!
|
|
136
|
-
() =>
|
|
137
|
+
!!accountConfig && !!getAccountScreen(),
|
|
138
|
+
() => {
|
|
139
|
+
const AccountScreen = getAccountScreen();
|
|
140
|
+
return AccountScreen ? createScreenWithProps("Account", AccountScreen, { config: accountConfig }) : null;
|
|
141
|
+
}
|
|
137
142
|
);
|
|
138
143
|
|
|
139
144
|
const videoTutorialScreen = createScreenWithProps("VideoTutorial", VideoTutorialsScreen, {
|
|
@@ -3,9 +3,15 @@ import { View, StyleSheet } from "react-native";
|
|
|
3
3
|
import { useAppNavigation } from "@umituz/react-native-design-system/molecules";
|
|
4
4
|
|
|
5
5
|
// ProfileSection is an optional peer — lazy require so the package works without @umituz/react-native-auth
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
// Returns null if @umituz/react-native-auth is not installed
|
|
7
|
+
const getProfileSection = (): React.ComponentType<any> | null => {
|
|
8
|
+
try {
|
|
9
|
+
return require("@umituz/react-native-auth").ProfileSection ?? null;
|
|
10
|
+
} catch {
|
|
11
|
+
// Auth package not available, silently return null
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
export interface ProfileSectionLoaderProps {
|
|
11
17
|
userProfile?: {
|
|
@@ -25,6 +31,7 @@ export interface ProfileSectionLoaderProps {
|
|
|
25
31
|
|
|
26
32
|
export const ProfileSectionLoader: React.FC<ProfileSectionLoaderProps> = React.memo(({ userProfile, translations }) => {
|
|
27
33
|
const navigation = useAppNavigation();
|
|
34
|
+
const ProfileSection = getProfileSection();
|
|
28
35
|
|
|
29
36
|
const handlePress = React.useCallback(() => {
|
|
30
37
|
if (!userProfile) return;
|