@umituz/react-native-settings 4.21.13 → 4.21.15

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.21.13",
3
+ "version": "4.21.15",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, rating, and gamification",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -47,8 +47,9 @@ export const GamificationScreenWrapper: React.FC<GamificationScreenWrapperProps>
47
47
  streakProps={{
48
48
  current: streak.current,
49
49
  longest: streak.longest,
50
- // streakLabel: config.translations.streakTitle, // Omitted by GamificationScreen types apparently
50
+ currentLabel: config.translations.currentStreak,
51
51
  bestLabel: config.translations.bestStreak,
52
+ daysLabel: config.translations.days,
52
53
  }}
53
54
  stats={[
54
55
  {
@@ -49,6 +49,8 @@ export interface GamificationTranslations {
49
49
  achievementsTitle: string;
50
50
  streakTitle: string;
51
51
  bestStreak: string;
52
+ currentStreak: string;
53
+ days: string;
52
54
  levelTitle: string;
53
55
  emptyAchievements: string;
54
56
  }
package/src/index.ts CHANGED
@@ -141,6 +141,7 @@ export {
141
141
  createRatingConfig,
142
142
  createFAQConfig,
143
143
  createSubscriptionConfig,
144
+ createGamificationConfig,
144
145
  type TranslationFunction,
145
146
  type FeedbackFormData,
146
147
  } from './presentation/utils';
@@ -16,6 +16,11 @@ import type {
16
16
  FAQConfig,
17
17
  SubscriptionConfig,
18
18
  } from "../screens/types";
19
+ import type {
20
+ GamificationConfig,
21
+ AchievementDefinition,
22
+ LevelDefinition,
23
+ } from "../../domains/gamification/types";
19
24
 
20
25
  /**
21
26
  * Translation function type
@@ -149,3 +154,30 @@ export const createSubscriptionConfig = (
149
154
  onPress: typeof routeOrOnPress === "function" ? routeOrOnPress : undefined,
150
155
  isPremium,
151
156
  });
157
+
158
+ /**
159
+ * Create gamification configuration
160
+ */
161
+ export const createGamificationConfig = (
162
+ t: TranslationFunction,
163
+ storageKey: string,
164
+ achievements: AchievementDefinition[],
165
+ levels: LevelDefinition[],
166
+ enabled = true,
167
+ ): GamificationConfig => ({
168
+ enabled,
169
+ storageKey,
170
+ achievements,
171
+ levels,
172
+ translations: {
173
+ title: t("settings.gamification.title"),
174
+ statsTitle: t("settings.gamification.stats.title"),
175
+ achievementsTitle: t("settings.gamification.achievements.title"),
176
+ streakTitle: t("settings.gamification.streak.title"),
177
+ bestStreak: t("settings.gamification.streak.best"),
178
+ currentStreak: t("settings.gamification.streak.current"),
179
+ days: t("settings.gamification.streak.days"),
180
+ levelTitle: t("settings.gamification.level.title"),
181
+ emptyAchievements: t("settings.gamification.achievements.empty"),
182
+ },
183
+ });