@umituz/react-native-settings 4.23.54 → 4.23.55
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.55",
|
|
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",
|
package/src/index.ts
CHANGED
|
@@ -32,12 +32,24 @@ import type { FeedbackFormData } from "../utils/config-creators";
|
|
|
32
32
|
import type { AppInfo, FAQData, UserProfileConfig, AdditionalScreen } from "../navigation/types";
|
|
33
33
|
import type { AccountScreenConfig } from "@umituz/react-native-auth";
|
|
34
34
|
|
|
35
|
+
export interface SettingsFeatures {
|
|
36
|
+
notifications?: boolean;
|
|
37
|
+
appearance?: boolean;
|
|
38
|
+
language?: boolean;
|
|
39
|
+
feedback?: boolean;
|
|
40
|
+
rating?: boolean;
|
|
41
|
+
faqs?: boolean;
|
|
42
|
+
about?: boolean;
|
|
43
|
+
legal?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
35
46
|
export interface UseSettingsScreenConfigParams {
|
|
36
47
|
appInfo: AppInfo;
|
|
37
48
|
faqData?: FAQData;
|
|
38
49
|
isPremium: boolean;
|
|
39
50
|
onFeedbackSubmit: (data: FeedbackFormData) => Promise<void>;
|
|
40
51
|
additionalScreens?: AdditionalScreen[];
|
|
52
|
+
features?: SettingsFeatures;
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
export interface SettingsScreenConfigResult {
|
|
@@ -52,7 +64,18 @@ export interface SettingsScreenConfigResult {
|
|
|
52
64
|
export const useSettingsScreenConfig = (
|
|
53
65
|
params: UseSettingsScreenConfigParams
|
|
54
66
|
): SettingsScreenConfigResult => {
|
|
55
|
-
const { appInfo, faqData, isPremium, onFeedbackSubmit } = params;
|
|
67
|
+
const { appInfo, faqData, isPremium, onFeedbackSubmit, features = {} } = params;
|
|
68
|
+
|
|
69
|
+
const {
|
|
70
|
+
notifications: showNotifications = true,
|
|
71
|
+
appearance: showAppearance = true,
|
|
72
|
+
language: showLanguage = true,
|
|
73
|
+
feedback: showFeedback = true,
|
|
74
|
+
rating: showRating = true,
|
|
75
|
+
faqs: showFaqs = true,
|
|
76
|
+
about: showAbout = true,
|
|
77
|
+
legal: showLegal = true,
|
|
78
|
+
} = features;
|
|
56
79
|
|
|
57
80
|
const { t } = useLocalization();
|
|
58
81
|
const { user, loading, isAuthReady, signOut } = useAuth();
|
|
@@ -88,17 +111,21 @@ export const useSettingsScreenConfig = (
|
|
|
88
111
|
}, [showAuthModal]);
|
|
89
112
|
|
|
90
113
|
const settingsConfig = useMemo((): SettingsConfig => ({
|
|
91
|
-
appearance: createAppearanceConfig(t),
|
|
92
|
-
language: createLanguageConfig(t),
|
|
93
|
-
notifications: createNotificationsConfig(t),
|
|
94
|
-
feedback: createFeedbackConfig(t, onFeedbackSubmit),
|
|
95
|
-
about: createAboutConfig(t),
|
|
96
|
-
legal: createLegalConfig(t),
|
|
97
|
-
faqs: createFAQConfig(t),
|
|
98
|
-
rating: createRatingConfig(t, handleRatePress, appInfo.appStoreUrl || ""),
|
|
114
|
+
appearance: showAppearance ? createAppearanceConfig(t) : false,
|
|
115
|
+
language: showLanguage ? createLanguageConfig(t) : false,
|
|
116
|
+
notifications: showNotifications ? createNotificationsConfig(t) : false,
|
|
117
|
+
feedback: showFeedback ? createFeedbackConfig(t, onFeedbackSubmit) : false,
|
|
118
|
+
about: showAbout ? createAboutConfig(t) : false,
|
|
119
|
+
legal: showLegal ? createLegalConfig(t) : false,
|
|
120
|
+
faqs: showFaqs ? createFAQConfig(t) : false,
|
|
121
|
+
rating: showRating ? createRatingConfig(t, handleRatePress, appInfo.appStoreUrl || "") : false,
|
|
99
122
|
subscription: createSubscriptionConfig(t, isPremium, "SubscriptionDetail"),
|
|
100
123
|
disclaimer: false,
|
|
101
|
-
}), [
|
|
124
|
+
}), [
|
|
125
|
+
t, onFeedbackSubmit, handleRatePress, appInfo.appStoreUrl, isPremium,
|
|
126
|
+
showAppearance, showLanguage, showNotifications, showFeedback,
|
|
127
|
+
showAbout, showLegal, showFaqs, showRating,
|
|
128
|
+
]);
|
|
102
129
|
|
|
103
130
|
const userProfile = useMemo((): UserProfileConfig => {
|
|
104
131
|
const isAnonymous = userProfileData?.isAnonymous ?? true;
|