@umituz/react-native-gamification 1.4.3 → 1.4.4
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-gamification",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "Generic gamification system for React Native apps - achievements, points, levels, streaks with customizable UI components",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -35,13 +35,15 @@
|
|
|
35
35
|
"react-native": ">=0.74.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
39
|
+
"@types/react": "~19.1.10",
|
|
38
40
|
"@umituz/react-native-design-system": "latest",
|
|
39
41
|
"@umituz/react-native-localization": "latest",
|
|
40
42
|
"@umituz/react-native-storage": "latest",
|
|
41
|
-
"@types/react": "~19.1.10",
|
|
42
43
|
"react": "19.1.0",
|
|
43
44
|
"react-native": "0.81.5",
|
|
44
|
-
"typescript": "~5.9.2"
|
|
45
|
+
"typescript": "~5.9.2",
|
|
46
|
+
"zustand": "^5.0.9"
|
|
45
47
|
},
|
|
46
48
|
"publishConfig": {
|
|
47
49
|
"access": "public"
|
|
@@ -58,8 +58,8 @@ export const useGamificationStore = createStore<GamificationState, GamificationA
|
|
|
58
58
|
}));
|
|
59
59
|
|
|
60
60
|
// Merge with existing unlocked achievements
|
|
61
|
-
const mergedAchievements = achievements.map((ach) => {
|
|
62
|
-
const existing = state.achievements.find((a) => a.id === ach.id);
|
|
61
|
+
const mergedAchievements = achievements.map((ach: Achievement) => {
|
|
62
|
+
const existing = state.achievements.find((a: Achievement) => a.id === ach.id);
|
|
63
63
|
if (existing) {
|
|
64
64
|
return { ...ach, isUnlocked: existing.isUnlocked, progress: existing.progress };
|
|
65
65
|
}
|
|
@@ -122,7 +122,7 @@ export const useGamificationStore = createStore<GamificationState, GamificationA
|
|
|
122
122
|
const state = get();
|
|
123
123
|
const newlyUnlocked: Achievement[] = [];
|
|
124
124
|
|
|
125
|
-
const updatedAchievements = state.achievements.map((ach) => {
|
|
125
|
+
const updatedAchievements = state.achievements.map((ach: Achievement) => {
|
|
126
126
|
if (ach.isUnlocked) return ach;
|
|
127
127
|
|
|
128
128
|
const progress = updateAchievementProgress(
|