@umituz/react-native-settings 4.23.115 → 4.23.117
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": "4.23.
|
|
3
|
+
"version": "4.23.117",
|
|
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": "./src/index.ts",
|
|
@@ -14,7 +14,6 @@ export interface ProfileSectionLoaderProps {
|
|
|
14
14
|
benefits?: string[];
|
|
15
15
|
};
|
|
16
16
|
translations?: {
|
|
17
|
-
guest?: string;
|
|
18
17
|
anonymousName?: string;
|
|
19
18
|
signIn?: string;
|
|
20
19
|
};
|
|
@@ -34,10 +33,8 @@ export const ProfileSectionLoader: React.FC<ProfileSectionLoaderProps> = React.m
|
|
|
34
33
|
|
|
35
34
|
const anonymousDisplayName = React.useMemo(() => {
|
|
36
35
|
if (!userProfile) return "";
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
: (translations?.anonymousName || "");
|
|
40
|
-
}, [userProfile, translations]);
|
|
36
|
+
return translations?.anonymousName || "";
|
|
37
|
+
}, [translations]);
|
|
41
38
|
|
|
42
39
|
if (!userProfile) return null;
|
|
43
40
|
|
|
@@ -49,6 +49,21 @@ export function createAccountConfig(params: CreateAccountConfigParams): AccountS
|
|
|
49
49
|
|
|
50
50
|
const anonymous = isAnonymous ?? true;
|
|
51
51
|
|
|
52
|
+
// Helper to check if translation value is valid (not empty or undefined)
|
|
53
|
+
const hasValidTranslation = (value: string | undefined): boolean => {
|
|
54
|
+
return Boolean(value && value.trim().length > 0);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Only create accountActions if all required translations are present and non-empty
|
|
58
|
+
const hasValidAccountTranslations = translations &&
|
|
59
|
+
hasValidTranslation(translations.logout) &&
|
|
60
|
+
hasValidTranslation(translations.deleteAccount) &&
|
|
61
|
+
hasValidTranslation(translations.logoutConfirmTitle) &&
|
|
62
|
+
hasValidTranslation(translations.logoutConfirmMessage) &&
|
|
63
|
+
hasValidTranslation(translations.deleteConfirmTitle) &&
|
|
64
|
+
hasValidTranslation(translations.deleteConfirmMessage) &&
|
|
65
|
+
hasValidTranslation(translations.cancel);
|
|
66
|
+
|
|
52
67
|
return {
|
|
53
68
|
profile: {
|
|
54
69
|
displayName: displayName || "",
|
|
@@ -59,7 +74,7 @@ export function createAccountConfig(params: CreateAccountConfigParams): AccountS
|
|
|
59
74
|
isAnonymous: anonymous,
|
|
60
75
|
editProfileText: translations?.editProfile || "",
|
|
61
76
|
onSignIn,
|
|
62
|
-
accountActions:
|
|
77
|
+
accountActions: hasValidAccountTranslations ? {
|
|
63
78
|
onLogout,
|
|
64
79
|
onDeleteAccount,
|
|
65
80
|
logoutText: translations.logout,
|