@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 +1 -1
- package/src/account.ts +5 -5
- package/src/domains/appearance/presentation/components/ThemeOption.tsx +1 -4
- package/src/domains/feedback/presentation/components/FeedbackForm.tsx +1 -1
- package/src/domains/gamification/utils/calculations.ts +10 -0
- package/src/domains/localization/presentation/screens/LanguageSelectionScreen.tsx +0 -1
- package/src/domains/notifications/infrastructure/services/NotificationPermissions.ts +1 -1
- package/src/presentation/hooks/useSettingsScreenConfig.ts +0 -1
- package/src/presentation/navigation/hooks/useSettingsScreens.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "5.3.
|
|
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
|
|
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
|
|
12
|
-
export const AccountScreen: React.ComponentType<
|
|
13
|
-
export const ProfileSection: React.ComponentType<
|
|
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 =
|
|
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]
|
|
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Notifications from 'expo-notifications';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
|
-
import { devWarn, devError
|
|
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<
|
|
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?:
|
|
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
|
|
119
|
+
categories: faqData?.categories ?? [],
|
|
120
120
|
searchPlaceholder: featureTranslations?.faqs?.searchPlaceholder || "",
|
|
121
121
|
emptySearchTitle: featureTranslations?.faqs?.emptySearchTitle || "",
|
|
122
122
|
emptySearchMessage: featureTranslations?.faqs?.emptySearchMessage || "",
|