@umituz/react-native-settings 4.23.94 → 4.23.96

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.94",
3
+ "version": "4.23.96",
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",
@@ -19,6 +19,7 @@ export const GamificationScreenWithConfig: React.FC<GamificationConfigProps> = (
19
19
 
20
20
  const {
21
21
  points,
22
+ totalTasksCompleted,
22
23
  level,
23
24
  streak,
24
25
  achievements,
@@ -59,10 +60,15 @@ export const GamificationScreenWithConfig: React.FC<GamificationConfigProps> = (
59
60
  },
60
61
  stats: [
61
62
  {
62
- label: config.translations.statsTitle,
63
+ label: config.translations.pointsLabel,
63
64
  value: points,
64
65
  icon: "star",
65
66
  },
67
+ {
68
+ label: config.translations.totalCompletedLabel,
69
+ value: totalTasksCompleted,
70
+ icon: "checkmark-circle",
71
+ },
66
72
  ],
67
73
  achievements: achievementItems,
68
74
  emptyAchievementsText: config.translations.emptyAchievements,
@@ -47,12 +47,12 @@ export const StreakDisplay: React.FC<StreakDisplayProps> = ({
47
47
 
48
48
  const renderedIcon = typeof icon === 'string' ? (
49
49
  <AtomicIcon name={icon} size="md" customColor={finalPrimaryColor} />
50
- ) : icon;
50
+ ) : icon || <AtomicIcon name="flame" size="md" customColor={finalPrimaryColor} />;
51
51
 
52
52
  return (
53
53
  <View style={[styles.container, { backgroundColor: finalBackgroundColor }, containerStyle]}>
54
54
  <View style={styles.mainStreak}>
55
- {renderedIcon && <View style={styles.iconContainer}>{renderedIcon}</View>}
55
+ <View style={styles.iconContainer}>{renderedIcon}</View>
56
56
  <View style={styles.streakInfo}>
57
57
  <AtomicText style={[styles.number, { color: finalPrimaryColor }, numberStyle]}>
58
58
  {current}
@@ -46,6 +46,8 @@ export interface StreakState {
46
46
  export interface GamificationTranslations {
47
47
  title: string;
48
48
  statsTitle: string;
49
+ pointsLabel: string;
50
+ totalCompletedLabel: string;
49
51
  achievementsTitle: string;
50
52
  streakTitle: string;
51
53
  bestStreak: string;
@@ -11,12 +11,16 @@ export interface GamificationSettingsItemProps {
11
11
  config: GamificationItemConfig;
12
12
  gamificationConfig?: GamificationSettingsConfig;
13
13
  t: (key: string) => string;
14
+ noBackground?: boolean;
15
+ hideMargin?: boolean;
14
16
  }
15
17
 
16
18
  const GamificationSettingsItemComponent: React.FC<GamificationSettingsItemProps> = ({
17
19
  config,
18
20
  gamificationConfig,
19
- t
21
+ t,
22
+ noBackground,
23
+ hideMargin,
20
24
  }) => {
21
25
  const navigation = useAppNavigation();
22
26
  const { level } = useGamification(gamificationConfig);
@@ -41,6 +45,8 @@ const GamificationSettingsItemComponent: React.FC<GamificationSettingsItemProps>
41
45
  icon={icon}
42
46
  onPress={handlePress}
43
47
  sectionTitle={config.sectionTitle}
48
+ noBackground={noBackground}
49
+ hideMargin={hideMargin}
44
50
  />
45
51
  );
46
52
  };
@@ -123,23 +123,31 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
123
123
  />
124
124
  )}
125
125
 
126
- {features.gamification && (
127
- <GamificationSettingsItem
128
- config={normalizedConfig.gamification.config || {}}
129
- gamificationConfig={gamificationConfig}
130
- t={t}
131
- />
132
- )}
126
+ <FeatureSettingsSection normalizedConfig={normalizedConfig} features={features} />
133
127
 
134
- {features.videoTutorial && (
135
- <VideoTutorialSettingsItem
136
- config={normalizedConfig.videoTutorial.config || {}}
137
- t={t}
138
- />
128
+ {(features.gamification || features.videoTutorial) && (
129
+ <SettingsSection title={t("settings.sections.progress")}>
130
+ {features.gamification && (
131
+ <GamificationSettingsItem
132
+ config={normalizedConfig.gamification.config || {}}
133
+ gamificationConfig={gamificationConfig}
134
+ t={t}
135
+ noBackground={true}
136
+ hideMargin={true}
137
+ />
138
+ )}
139
+
140
+ {features.videoTutorial && (
141
+ <VideoTutorialSettingsItem
142
+ config={normalizedConfig.videoTutorial.config || {}}
143
+ t={t}
144
+ noBackground={true}
145
+ hideMargin={true}
146
+ />
147
+ )}
148
+ </SettingsSection>
139
149
  )}
140
150
 
141
- <FeatureSettingsSection normalizedConfig={normalizedConfig} features={features} />
142
-
143
151
  <IdentitySettingsSection normalizedConfig={normalizedConfig} features={features} />
144
152
 
145
153
  <SupportSettingsSection normalizedConfig={normalizedConfig} features={features} />
@@ -8,11 +8,15 @@ import { compareConfigAndTranslate } from "../../../infrastructure/utils/memoCom
8
8
  export interface VideoTutorialSettingsItemProps {
9
9
  config: VideoTutorialConfig;
10
10
  t: (key: string) => string;
11
+ noBackground?: boolean;
12
+ hideMargin?: boolean;
11
13
  }
12
14
 
13
15
  const VideoTutorialSettingsItemComponent: React.FC<VideoTutorialSettingsItemProps> = ({
14
16
  config,
15
- t
17
+ t,
18
+ noBackground,
19
+ hideMargin,
16
20
  }) => {
17
21
  const navigation = useAppNavigation();
18
22
 
@@ -36,6 +40,8 @@ const VideoTutorialSettingsItemComponent: React.FC<VideoTutorialSettingsItemProp
36
40
  icon={icon}
37
41
  onPress={handlePress}
38
42
  sectionTitle={config.sectionTitle}
43
+ noBackground={noBackground}
44
+ hideMargin={hideMargin}
39
45
  />
40
46
  );
41
47
  };
@@ -50,6 +50,8 @@ export const createGamificationConfig = (
50
50
  translations: {
51
51
  title: t("settings.gamification.title"),
52
52
  statsTitle: t("settings.gamification.stats.title"),
53
+ pointsLabel: t("settings.gamification.stats.points"),
54
+ totalCompletedLabel: t("settings.gamification.stats.totalCompleted"),
53
55
  achievementsTitle: t("settings.gamification.achievements.title"),
54
56
  streakTitle: t("settings.gamification.streak.title"),
55
57
  bestStreak: t("settings.gamification.streak.best"),