@umituz/react-native-settings 4.23.101 → 4.23.103

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.101",
3
+ "version": "4.23.103",
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
 
@@ -105,6 +114,26 @@ export const useSettingsScreenConfig = (
105
114
  };
106
115
  }
107
116
 
117
+ // Add gamification title and description
118
+ if ((config.gamification === true || (config.gamification && typeof config.gamification === 'object')) && translations?.features?.gamification) {
119
+ const existingConfig = typeof config.gamification === 'object' ? config.gamification : { enabled: true, storageKey: '' };
120
+ config.gamification = {
121
+ ...existingConfig,
122
+ title: translations.features.gamification.title,
123
+ description: translations.features.gamification.description,
124
+ };
125
+ }
126
+
127
+ // Add videoTutorial title and description
128
+ if ((config.videoTutorial === true || (config.videoTutorial && typeof config.videoTutorial === 'object')) && translations?.features?.videoTutorial) {
129
+ const existingConfig = typeof config.videoTutorial === 'object' ? config.videoTutorial : { enabled: true };
130
+ config.videoTutorial = {
131
+ ...existingConfig,
132
+ title: translations.features.videoTutorial.title,
133
+ description: translations.features.videoTutorial.description,
134
+ };
135
+ }
136
+
108
137
  return config;
109
138
  }, [baseSettingsConfig, translations]);
110
139
 
@@ -130,24 +130,14 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
130
130
 
131
131
  <FeatureSettingsSection normalizedConfig={normalizedConfig} features={features} />
132
132
 
133
- {(features.gamification || features.videoTutorial) && (
133
+ {features.gamification && (
134
134
  <SettingsSection title={translations?.sections?.progress}>
135
- {features.gamification && (
136
- <GamificationSettingsItem
137
- config={normalizedConfig.gamification.config || {}}
138
- gamificationConfig={gamificationConfig}
139
- noBackground={true}
140
- hideMargin={true}
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
  };
@@ -156,6 +156,10 @@ export interface SettingsTranslations {
156
156
  title?: string;
157
157
  description?: string;
158
158
  };
159
+ gamification?: {
160
+ title?: string;
161
+ description?: string;
162
+ };
159
163
  };
160
164
  feedbackModal?: {
161
165
  title?: string;
@@ -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
  };