@umituz/react-native-settings 5.3.68 → 5.3.70

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": "5.3.68",
3
+ "version": "5.3.70",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification - expo-store-review and expo-device now lazy loaded",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./dist/index.d.ts",
package/src/account.ts CHANGED
@@ -2,15 +2,15 @@
2
2
  * @umituz/react-native-settings/account
3
3
  *
4
4
  * NOTE: Auth has been removed from this application.
5
- * This file now provides empty exports for backward compatibility.
5
+ * This file provides empty exports for compatibility.
6
6
  *
7
7
  * Apps that use @umituz/react-native-auth should import directly from that package:
8
8
  * import { AccountScreen, ProfileSection } from '@umituz/react-native-auth';
9
9
  */
10
10
 
11
- // Empty exports for backward compatibility
12
- export const AccountScreen: React.ComponentType<any> | null = null;
13
- export const ProfileSection: React.ComponentType<any> | null = null;
11
+ // Empty exports
12
+ export const AccountScreen: React.ComponentType<Record<string, never>> | null = null;
13
+ export const ProfileSection: React.ComponentType<Record<string, never>> | null = null;
14
14
 
15
15
  // Stub hooks that return default values
16
16
  export const useAuth = () => ({
@@ -30,7 +30,7 @@ export const useAuthHandlers = () => ({
30
30
  });
31
31
 
32
32
  // Empty types
33
- export type AccountScreenConfig = any;
33
+ export type AccountScreenConfig = Record<string, never>;
34
34
 
35
35
  // Base hook (no auth version)
36
36
  export { useSettingsScreenConfig } from './presentation/hooks/useSettingsScreenConfig';
@@ -22,9 +22,6 @@ interface ThemeOptionProps {
22
22
  onSelect: () => void;
23
23
  }
24
24
 
25
- // Valid theme modes for validation
26
- const VALID_THEME_MODES: readonly ThemeMode[] = ["light", "dark", "auto"];
27
-
28
25
  // Utility function to add opacity to hex color
29
26
  const addOpacityToHex = (hexColor: string, opacity: string): string => {
30
27
  // Remove # if present
@@ -33,7 +30,7 @@ const addOpacityToHex = (hexColor: string, opacity: string): string => {
33
30
  };
34
31
 
35
32
  export const ThemeOption: React.FC<ThemeOptionProps> = React.memo(({
36
- mode,
33
+ mode: _mode,
37
34
  title,
38
35
  subtitle,
39
36
  description,
@@ -148,7 +148,7 @@ export const FeedbackForm: React.FC<FeedbackFormProps> = ({
148
148
  const styles = getStyles(tokens);
149
149
 
150
150
  const [state, dispatch] = useReducer(feedbackFormReducer, {
151
- selectedType: initialType || texts.feedbackTypes[0].type,
151
+ selectedType: initialType || (texts.feedbackTypes[0]?.type ?? 'general'),
152
152
  rating: 5,
153
153
  description: "",
154
154
  title: "",
@@ -11,6 +11,16 @@ export const calculateLevel = (
11
11
  ): LevelState => {
12
12
  const sortedLevels = [...levels].sort((a, b) => a.minPoints - b.minPoints);
13
13
 
14
+ if (sortedLevels.length === 0) {
15
+ // Return default level state if no levels are defined
16
+ return {
17
+ currentLevel: 1,
18
+ currentPoints: points,
19
+ pointsToNext: 0,
20
+ progress: 0,
21
+ };
22
+ }
23
+
14
24
  let currentLevelDef = sortedLevels[0];
15
25
  let nextLevelDef: LevelDefinition | null = null;
16
26
 
@@ -154,7 +154,6 @@ export const LanguageSelectionScreen: React.FC<LanguageSelectionProps> = ({
154
154
  <NavigationHeader
155
155
  title={headerTitle || ""}
156
156
  onBackPress={handleBack}
157
- centerTitle={true}
158
157
  />
159
158
  ) : null
160
159
  }
@@ -1,6 +1,6 @@
1
1
  import * as Notifications from 'expo-notifications';
2
2
  import { Platform } from 'react-native';
3
- import { devWarn, devError, devLog } from '../../../../utils/devUtils';
3
+ import { devWarn, devError } from '../../../../utils/devUtils';
4
4
 
5
5
  export class NotificationPermissions {
6
6
  async requestPermissions(): Promise<boolean> {
@@ -94,7 +94,6 @@ export const useSettingsScreenConfig = (
94
94
 
95
95
  const handleRatePress = useMemo(() => async () => {
96
96
  // Default rate behavior - typically handled by app or a separate rating hook
97
- console.log("[useSettingsScreenConfig] Rate pressed");
98
97
  }, []);
99
98
 
100
99
  // Use settings config factory
@@ -6,7 +6,7 @@ import { SettingsScreen } from "../../screens/SettingsScreen";
6
6
 
7
7
  // AccountScreen is an optional peer — lazy require so the package works without @umituz/react-native-auth
8
8
  // Returns null if @umituz/react-native-auth is not installed
9
- const getAccountScreen = (): React.ComponentType<any> | null => {
9
+ const getAccountScreen = (): React.ComponentType<Record<string, unknown>> | null => {
10
10
  try {
11
11
  return require("@umituz/react-native-auth").AccountScreen ?? null;
12
12
  } catch {
@@ -40,7 +40,7 @@ export interface UseSettingsScreensProps extends SettingsStackNavigatorProps {
40
40
  legalProps: LegalScreenProps;
41
41
  notificationTranslations: NotificationSettingsTranslations;
42
42
  quietHoursTranslations: QuietHoursTranslations;
43
- navigation?: any;
43
+ navigation?: Record<string, unknown>;
44
44
  }
45
45
 
46
46
  export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[] => {
@@ -116,7 +116,7 @@ export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[
116
116
  const faqScreen = createConditionalScreen(
117
117
  !!(faqData && faqData.categories?.length > 0),
118
118
  () => createScreenWithProps("FAQ", FAQScreen, {
119
- categories: faqData!.categories,
119
+ categories: faqData?.categories ?? [],
120
120
  searchPlaceholder: featureTranslations?.faqs?.searchPlaceholder || "",
121
121
  emptySearchTitle: featureTranslations?.faqs?.emptySearchTitle || "",
122
122
  emptySearchMessage: featureTranslations?.faqs?.emptySearchMessage || "",