@umituz/react-native-settings 4.23.101 → 4.23.102
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 +1 -1
- package/src/presentation/hooks/useSettingsScreenConfig.ts +9 -0
- package/src/presentation/screens/components/SettingsContent.tsx +7 -17
- package/src/presentation/screens/components/sections/SupportSettingsSection.tsx +10 -1
- package/src/presentation/utils/settingsConfigFactory.ts +9 -1
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.102",
|
|
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",
|
|
@@ -28,6 +28,9 @@ export interface SettingsFeatures {
|
|
|
28
28
|
faqs?: boolean;
|
|
29
29
|
about?: boolean;
|
|
30
30
|
legal?: boolean;
|
|
31
|
+
gamification?: boolean;
|
|
32
|
+
videoTutorial?: boolean;
|
|
33
|
+
subscription?: boolean;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export interface UseSettingsScreenConfigParams {
|
|
@@ -63,6 +66,9 @@ export const useSettingsScreenConfig = (
|
|
|
63
66
|
faqs: showFaqs = true,
|
|
64
67
|
about: showAbout = true,
|
|
65
68
|
legal: showLegal = true,
|
|
69
|
+
gamification: showGamification = true,
|
|
70
|
+
videoTutorial: showVideoTutorial = true,
|
|
71
|
+
subscription: showSubscription = true,
|
|
66
72
|
} = features;
|
|
67
73
|
|
|
68
74
|
const { user, loading, isAuthReady } = useAuth();
|
|
@@ -87,6 +93,9 @@ export const useSettingsScreenConfig = (
|
|
|
87
93
|
faqs: showFaqs,
|
|
88
94
|
about: showAbout,
|
|
89
95
|
legal: showLegal,
|
|
96
|
+
gamification: showGamification,
|
|
97
|
+
videoTutorial: showVideoTutorial,
|
|
98
|
+
subscription: showSubscription,
|
|
90
99
|
},
|
|
91
100
|
});
|
|
92
101
|
|
|
@@ -130,24 +130,14 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
130
130
|
|
|
131
131
|
<FeatureSettingsSection normalizedConfig={normalizedConfig} features={features} />
|
|
132
132
|
|
|
133
|
-
{
|
|
133
|
+
{features.gamification && (
|
|
134
134
|
<SettingsSection title={translations?.sections?.progress}>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/>
|
|
142
|
-
)}
|
|
143
|
-
|
|
144
|
-
{features.videoTutorial && (
|
|
145
|
-
<VideoTutorialSettingsItem
|
|
146
|
-
config={normalizedConfig.videoTutorial.config || {}}
|
|
147
|
-
noBackground={true}
|
|
148
|
-
hideMargin={true}
|
|
149
|
-
/>
|
|
150
|
-
)}
|
|
135
|
+
<GamificationSettingsItem
|
|
136
|
+
config={normalizedConfig.gamification.config || {}}
|
|
137
|
+
gamificationConfig={gamificationConfig}
|
|
138
|
+
noBackground={true}
|
|
139
|
+
hideMargin={true}
|
|
140
|
+
/>
|
|
151
141
|
</SettingsSection>
|
|
152
142
|
)}
|
|
153
143
|
|
|
@@ -3,6 +3,7 @@ import { useAppNavigation } from "@umituz/react-native-design-system";
|
|
|
3
3
|
import { SupportSection } from "../../../../domains/feedback/presentation/components/SupportSection";
|
|
4
4
|
import { SettingsSection } from "../../../components/SettingsSection";
|
|
5
5
|
import { SettingsItemCard } from "../../../components/SettingsItemCard";
|
|
6
|
+
import { VideoTutorialSettingsItem } from "../VideoTutorialSettingsItem";
|
|
6
7
|
import type { NormalizedConfig } from "../../utils/normalizeConfig";
|
|
7
8
|
import { compareConfigAndFeatures } from "../../../../infrastructure/utils/memoComparisonUtils";
|
|
8
9
|
|
|
@@ -22,7 +23,7 @@ export const SupportSettingsSection: React.FC<SupportSettingsSectionProps> = ({
|
|
|
22
23
|
navigation.navigate("FAQ" as never);
|
|
23
24
|
}, [navigation]);
|
|
24
25
|
|
|
25
|
-
if (!(features.feedback || features.rating || features.faqs)) return null;
|
|
26
|
+
if (!(features.feedback || features.rating || features.faqs || features.videoTutorial)) return null;
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
29
|
<SettingsSection title={translations?.sections?.support}>
|
|
@@ -94,6 +95,14 @@ export const SupportSettingsSection: React.FC<SupportSettingsSectionProps> = ({
|
|
|
94
95
|
hideMargin={true}
|
|
95
96
|
/>
|
|
96
97
|
)}
|
|
98
|
+
|
|
99
|
+
{features.videoTutorial && (
|
|
100
|
+
<VideoTutorialSettingsItem
|
|
101
|
+
config={normalizedConfig.videoTutorial.config || {}}
|
|
102
|
+
noBackground={true}
|
|
103
|
+
hideMargin={true}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
97
106
|
</SettingsSection>
|
|
98
107
|
);
|
|
99
108
|
};
|
|
@@ -32,6 +32,9 @@ export interface SettingsConfigFactoryParams {
|
|
|
32
32
|
faqs: boolean;
|
|
33
33
|
about: boolean;
|
|
34
34
|
legal: boolean;
|
|
35
|
+
gamification: boolean;
|
|
36
|
+
videoTutorial: boolean;
|
|
37
|
+
subscription: boolean;
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
|
|
@@ -58,7 +61,9 @@ export const createSettingsConfig = (
|
|
|
58
61
|
legal: features.legal ? createLegalConfig() : false,
|
|
59
62
|
faqs: features.faqs ? createFAQConfig() : false,
|
|
60
63
|
rating: features.rating ? createRatingConfig(handleRatePress, appStoreUrl) : false,
|
|
61
|
-
subscription: createSubscriptionConfig(isPremium, "SubscriptionDetail"),
|
|
64
|
+
subscription: features.subscription ? createSubscriptionConfig(isPremium, "SubscriptionDetail") : false,
|
|
65
|
+
gamification: features.gamification ? true : false,
|
|
66
|
+
videoTutorial: features.videoTutorial ? true : false,
|
|
62
67
|
disclaimer: false,
|
|
63
68
|
};
|
|
64
69
|
};
|
|
@@ -82,5 +87,8 @@ export const useSettingsConfigFactory = (
|
|
|
82
87
|
params.features.legal,
|
|
83
88
|
params.features.faqs,
|
|
84
89
|
params.features.rating,
|
|
90
|
+
params.features.gamification,
|
|
91
|
+
params.features.videoTutorial,
|
|
92
|
+
params.features.subscription,
|
|
85
93
|
]);
|
|
86
94
|
};
|