@umituz/react-native-settings 4.23.91 → 4.23.92

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.91",
3
+ "version": "4.23.92",
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",
@@ -5,12 +5,12 @@
5
5
 
6
6
  import React from "react";
7
7
  import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
8
- import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
8
+ import { useAppDesignTokens, AtomicText, AtomicIcon, withAlpha } from "@umituz/react-native-design-system";
9
9
 
10
10
  export interface AchievementItemProps {
11
11
  title: string;
12
12
  description: string;
13
- icon: React.ReactNode;
13
+ icon: React.ReactNode | string;
14
14
  isUnlocked: boolean;
15
15
  progress: number;
16
16
  threshold: number;
@@ -51,6 +51,10 @@ export const AchievementItem: React.FC<AchievementItemProps> = ({
51
51
  const finalSubtextColor = subtextColor || tokens.colors.textSecondary;
52
52
  const finalLockedOpacity = lockedOpacity !== undefined ? lockedOpacity : 0.5;
53
53
 
54
+ const renderedIcon = typeof icon === 'string' ? (
55
+ <AtomicIcon name={icon} size="md" customColor={finalAccentColor} />
56
+ ) : icon;
57
+
54
58
  const progressPercent = Math.min((progress / threshold) * 100, 100);
55
59
 
56
60
  return (
@@ -64,7 +68,7 @@ export const AchievementItem: React.FC<AchievementItemProps> = ({
64
68
  <View
65
69
  style={[styles.iconContainer, { backgroundColor: withAlpha(finalAccentColor, 0.2) }]}
66
70
  >
67
- {icon}
71
+ {renderedIcon}
68
72
  </View>
69
73
 
70
74
  <View style={styles.content}>
@@ -5,12 +5,12 @@
5
5
 
6
6
  import React from "react";
7
7
  import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
8
- import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
8
+ import { useAppDesignTokens, AtomicText, AtomicIcon, withAlpha } from "@umituz/react-native-design-system";
9
9
 
10
10
  export interface StatsCardProps {
11
11
  value: number;
12
12
  label: string;
13
- icon: React.ReactNode;
13
+ icon: React.ReactNode | string;
14
14
  suffix?: string;
15
15
  containerStyle?: ViewStyle;
16
16
  valueStyle?: TextStyle;
@@ -41,10 +41,14 @@ export const StatsCard: React.FC<StatsCardProps> = ({
41
41
  const finalTextColor = textColor || tokens.colors.textPrimary;
42
42
  const finalSubtextColor = subtextColor || tokens.colors.textSecondary;
43
43
 
44
+ const renderedIcon = typeof icon === 'string' ? (
45
+ <AtomicIcon name={icon} size="sm" customColor={finalAccentColor} />
46
+ ) : icon;
47
+
44
48
  return (
45
49
  <View style={[styles.container, { backgroundColor: finalBackgroundColor }, containerStyle]}>
46
50
  <View style={[styles.iconContainer, { backgroundColor: withAlpha(finalAccentColor, 0.15) }]}>
47
- {icon}
51
+ {renderedIcon}
48
52
  </View>
49
53
  <View style={styles.valueRow}>
50
54
  <AtomicText style={[styles.value, { color: finalTextColor }, valueStyle]}>
@@ -5,7 +5,7 @@
5
5
 
6
6
  import React from "react";
7
7
  import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
8
- import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
8
+ import { useAppDesignTokens, AtomicText, AtomicIcon, withAlpha } from "@umituz/react-native-design-system";
9
9
 
10
10
  export interface StreakDisplayProps {
11
11
  current: number;
@@ -13,7 +13,7 @@ export interface StreakDisplayProps {
13
13
  currentLabel: string;
14
14
  bestLabel: string;
15
15
  daysLabel: string;
16
- icon?: React.ReactNode;
16
+ icon?: React.ReactNode | string;
17
17
  containerStyle?: ViewStyle;
18
18
  numberStyle?: TextStyle;
19
19
  labelStyle?: TextStyle;
@@ -45,10 +45,14 @@ export const StreakDisplay: React.FC<StreakDisplayProps> = ({
45
45
  const finalTextColor = textColor || tokens.colors.textPrimary;
46
46
  const finalSubtextColor = subtextColor || tokens.colors.textSecondary;
47
47
 
48
+ const renderedIcon = typeof icon === 'string' ? (
49
+ <AtomicIcon name={icon} size="md" customColor={finalPrimaryColor} />
50
+ ) : icon;
51
+
48
52
  return (
49
53
  <View style={[styles.container, { backgroundColor: finalBackgroundColor }, containerStyle]}>
50
54
  <View style={styles.mainStreak}>
51
- {icon && <View style={styles.iconContainer}>{icon}</View>}
55
+ {renderedIcon && <View style={styles.iconContainer}>{renderedIcon}</View>}
52
56
  <View style={styles.streakInfo}>
53
57
  <AtomicText style={[styles.number, { color: finalPrimaryColor }, numberStyle]}>
54
58
  {current}
@@ -3,7 +3,7 @@
3
3
  * Zustand store with persist middleware
4
4
  */
5
5
 
6
- import { createStore } from "@umituz/react-native-design-system";
6
+ import { createStore, storageService } from "@umituz/react-native-design-system";
7
7
  import type {
8
8
  GamificationState,
9
9
  GamificationActions,
@@ -36,6 +36,7 @@ export const useGamificationStore = createStore<GamificationState, GamificationA
36
36
  name: "gamification-storage",
37
37
  initialState: DEFAULT_STATE,
38
38
  persist: true,
39
+ storage: storageService,
39
40
  version: 1,
40
41
  partialize: (state) => ({
41
42
  points: state.points,