@umituz/react-native-settings 5.3.49 → 5.3.50

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.
@@ -6,5 +6,10 @@ import type { LevelDefinition, LevelState, AchievementDefinition } from "../type
6
6
  export declare const calculateLevel: (points: number, levels: LevelDefinition[]) => LevelState;
7
7
  export declare const checkAchievementUnlock: (definition: AchievementDefinition, tasksCompleted: number, currentStreak: number) => boolean;
8
8
  export declare const updateAchievementProgress: (definition: AchievementDefinition, tasksCompleted: number, currentStreak: number) => number;
9
+ /**
10
+ * Check if streak is active based on last activity date
11
+ * Returns true if last activity was today or yesterday
12
+ * FIXED: Now uses date comparison instead of hour-based calculation to avoid timezone issues
13
+ */
9
14
  export declare const isStreakActive: (lastActivityDate: string | null) => boolean;
10
15
  export declare const isSameDay: (date1: Date, date2: Date) => boolean;
@@ -8,5 +8,6 @@ export interface UseSettingsScreensProps extends SettingsStackNavigatorProps {
8
8
  legalProps: LegalScreenProps;
9
9
  notificationTranslations: NotificationSettingsTranslations;
10
10
  quietHoursTranslations: QuietHoursTranslations;
11
+ navigation?: any;
11
12
  }
12
13
  export declare const useSettingsScreens: (props: UseSettingsScreensProps) => StackScreen[];
@@ -45,5 +45,7 @@ export interface SettingsScreenProps {
45
45
  showHeader?: boolean;
46
46
  /** Password prompt modal component */
47
47
  PasswordPromptComponent?: React.ReactNode;
48
+ /** Navigation object for custom sections */
49
+ navigation?: any;
48
50
  }
49
51
  export declare const SettingsScreen: React.FC<SettingsScreenProps>;
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import type { CustomSettingsSection } from "../../types";
3
3
  interface CustomSettingsListProps {
4
4
  customSections?: CustomSettingsSection[];
5
+ navigation?: any;
5
6
  }
6
7
  export declare const CustomSettingsList: React.FC<CustomSettingsListProps>;
7
8
  export {};
@@ -44,4 +44,5 @@ export interface SettingsContentProps {
44
44
  emptyStateText?: string;
45
45
  devSettings?: DevSettingsProps;
46
46
  gamificationConfig?: GamificationSettingsConfig;
47
+ navigation?: any;
47
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-settings",
3
- "version": "5.3.49",
3
+ "version": "5.3.50",
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": "./dist/index.d.ts",
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from "react";
9
+ import { useNavigation } from "@react-navigation/native";
9
10
  import { StackNavigator, type StackNavigatorConfig } from "@umituz/react-native-design-system/molecules";
10
11
  import { useNavigationHandlers, useSettingsScreens } from "./hooks";
11
12
  import {
@@ -41,12 +42,16 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = (pr
41
42
  [translations, handlePrivacyPress, handleTermsPress, handleEulaPress]
42
43
  );
43
44
 
45
+ // Get navigation for custom sections
46
+ const navigation = useNavigation();
47
+
44
48
  const screens = useSettingsScreens({
45
49
  ...props,
46
50
  aboutConfig,
47
51
  legalProps: legalScreenProps,
48
52
  notificationTranslations,
49
53
  quietHoursTranslations,
54
+ navigation,
50
55
  });
51
56
 
52
57
  const navigatorConfig: StackNavigatorConfig<SettingsStackParamList> = {
@@ -38,6 +38,7 @@ export interface UseSettingsScreensProps extends SettingsStackNavigatorProps {
38
38
  legalProps: LegalScreenProps;
39
39
  notificationTranslations: NotificationSettingsTranslations;
40
40
  quietHoursTranslations: QuietHoursTranslations;
41
+ navigation?: any;
41
42
  }
42
43
 
43
44
  export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[] => {
@@ -60,6 +61,7 @@ export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[
60
61
  gamificationConfig,
61
62
  videoTutorialConfig,
62
63
  accountConfig,
64
+ navigation,
63
65
  } = props;
64
66
 
65
67
  const translations = config?.translations;
@@ -79,6 +81,7 @@ export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[
79
81
  showHeader,
80
82
  showCloseButton,
81
83
  onClose,
84
+ navigation,
82
85
  }
83
86
  );
84
87
 
@@ -198,5 +201,6 @@ export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[
198
201
  gamificationConfig,
199
202
  videoTutorialConfig,
200
203
  accountConfig,
204
+ navigation,
201
205
  ]);
202
206
  };
@@ -51,6 +51,8 @@ export interface SettingsScreenProps {
51
51
  showHeader?: boolean;
52
52
  /** Password prompt modal component */
53
53
  PasswordPromptComponent?: React.ReactNode;
54
+ /** Navigation object for custom sections */
55
+ navigation?: any;
54
56
  }
55
57
 
56
58
  export const SettingsScreen: React.FC<SettingsScreenProps> = (props) => {
@@ -70,6 +72,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = (props) => {
70
72
  devSettings,
71
73
  gamificationConfig,
72
74
  PasswordPromptComponent,
75
+ navigation,
73
76
  } = props;
74
77
 
75
78
  const {
@@ -109,6 +112,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = (props) => {
109
112
  customSections={customSections}
110
113
  devSettings={devSettings}
111
114
  gamificationConfig={gamificationConfig}
115
+ navigation={navigation}
112
116
  />
113
117
  )}
114
118
  </ScreenLayout>
@@ -29,6 +29,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
29
29
  emptyStateText,
30
30
  devSettings,
31
31
  gamificationConfig,
32
+ navigation,
32
33
  }) => {
33
34
  const translations = normalizedConfig.translations;
34
35
  const { level } = useGamification(gamificationConfig);
@@ -54,7 +55,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
54
55
  />
55
56
  )}
56
57
 
57
- <CustomSettingsList customSections={customSections} />
58
+ <CustomSettingsList customSections={customSections} navigation={navigation} />
58
59
 
59
60
  {features.subscription && (normalizedConfig.subscription.config?.route || normalizedConfig.subscription.config?.onPress) && (
60
61
  <SettingsSection title={translations?.sections?.subscription || ''}>
@@ -5,6 +5,7 @@ import type { CustomSettingsSection } from "../../types";
5
5
 
6
6
  interface CustomSettingsListProps {
7
7
  customSections?: CustomSettingsSection[];
8
+ navigation?: any;
8
9
  }
9
10
 
10
11
  const EMPTY_SECTIONS: CustomSettingsSection[] = [];
@@ -48,4 +48,5 @@ export interface SettingsContentProps {
48
48
  emptyStateText?: string;
49
49
  devSettings?: DevSettingsProps;
50
50
  gamificationConfig?: GamificationSettingsConfig;
51
+ navigation?: any;
51
52
  }