@umituz/react-native-settings 4.21.13 → 4.21.14
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.
|
|
3
|
+
"version": "4.21.14",
|
|
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
|
-
|
|
50
|
+
currentLabel: config.translations.currentStreak,
|
|
51
51
|
bestLabel: config.translations.bestStreak,
|
|
52
|
+
daysLabel: config.translations.days,
|
|
52
53
|
}}
|
|
53
54
|
stats={[
|
|
54
55
|
{
|
package/src/index.ts
CHANGED
|
@@ -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
|
+
});
|