@umituz/react-native-settings 5.3.78 → 5.3.80
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/domains/dev/presentation/components/DevSettingsSection.tsx +2 -1
- package/src/domains/dev/presentation/components/StorageClearSetting.tsx +2 -1
- package/src/domains/feedback/infrastructure/useFeatureRequests.ts +7 -8
- package/src/domains/feedback/presentation/screens/FeatureRequestScreen.tsx +2 -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.80",
|
|
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",
|
|
@@ -12,6 +12,7 @@ import { Alert } from "react-native";
|
|
|
12
12
|
import { storageRepository } from "@umituz/react-native-design-system/storage";
|
|
13
13
|
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
14
14
|
import { SettingsSection } from "../../../../presentation/components/SettingsSection";
|
|
15
|
+
import { isDev } from "../../../../utils/devUtils";
|
|
15
16
|
import { SettingsItemCard } from "../../../../presentation/components/SettingsItemCard";
|
|
16
17
|
|
|
17
18
|
// Default texts (English only - DEV feature)
|
|
@@ -55,7 +56,7 @@ export const DevSettingsSection: React.FC<DevSettingsProps> = ({
|
|
|
55
56
|
const t = { ...DEFAULT_TEXTS, ...texts };
|
|
56
57
|
|
|
57
58
|
// Only render in development mode and when enabled
|
|
58
|
-
if (!
|
|
59
|
+
if (!isDev() || !enabled) {
|
|
59
60
|
return null;
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { SettingsItemCard } from "../../../../presentation/components/SettingsItemCard";
|
|
9
|
+
import { isDev } from "../../../../utils/devUtils";
|
|
9
10
|
|
|
10
11
|
export interface StorageClearSettingProps {
|
|
11
12
|
title?: string;
|
|
@@ -21,7 +22,7 @@ export const StorageClearSetting: React.FC<StorageClearSettingProps> = ({
|
|
|
21
22
|
iconColor,
|
|
22
23
|
}) => {
|
|
23
24
|
// Only render in DEV mode
|
|
24
|
-
if (!
|
|
25
|
+
if (!isDev()) {
|
|
25
26
|
return null;
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { useState, useEffect, useCallback, useRef } from "react";
|
|
12
12
|
import { Platform } from "react-native";
|
|
13
13
|
import * as Crypto from "expo-crypto";
|
|
14
|
+
import { devWarn } from "../../../utils/devUtils";
|
|
14
15
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
15
16
|
import type {
|
|
16
17
|
FeatureRequestItem,
|
|
@@ -64,11 +65,9 @@ function loadFirebase(): typeof firebaseModules {
|
|
|
64
65
|
return firebaseModules;
|
|
65
66
|
} catch (error) {
|
|
66
67
|
// Firebase not installed - return null to disable features
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
71
|
-
}
|
|
68
|
+
devWarn(
|
|
69
|
+
"[useFeatureRequests] @umituz/react-native-firebase not installed. Feature requests disabled.",
|
|
70
|
+
);
|
|
72
71
|
firebaseModules = null;
|
|
73
72
|
return null;
|
|
74
73
|
}
|
|
@@ -92,7 +91,7 @@ async function getAnonymousUserId(): Promise<string> {
|
|
|
92
91
|
return newId;
|
|
93
92
|
} catch (error) {
|
|
94
93
|
// Fallback to timestamp-based ID if crypto fails
|
|
95
|
-
const fallbackId = `anon_${Date.now()}_${Math.random().toString(36).
|
|
94
|
+
const fallbackId = `anon_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
96
95
|
await AsyncStorage.setItem(ANONYMOUS_USER_ID_KEY, fallbackId);
|
|
97
96
|
return fallbackId;
|
|
98
97
|
}
|
|
@@ -189,7 +188,7 @@ export function useFeatureRequests(): UseFeatureRequestsResult {
|
|
|
189
188
|
setUserVotes({});
|
|
190
189
|
}
|
|
191
190
|
} catch (error) {
|
|
192
|
-
|
|
191
|
+
devWarn("[useFeatureRequests] Load failed:", error);
|
|
193
192
|
} finally {
|
|
194
193
|
setIsLoading(false);
|
|
195
194
|
}
|
|
@@ -253,7 +252,7 @@ export function useFeatureRequests(): UseFeatureRequestsResult {
|
|
|
253
252
|
await fb.updateDoc(requestRef, { votes: fb.increment(type === "up" ? 1 : -1) });
|
|
254
253
|
}
|
|
255
254
|
} catch (error) {
|
|
256
|
-
|
|
255
|
+
devWarn("[useFeatureRequests] Vote failed:", error);
|
|
257
256
|
// Rollback using previous known state
|
|
258
257
|
setUserVotes((prev) => {
|
|
259
258
|
const next = { ...prev };
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
AtomicIcon,
|
|
12
12
|
} from "@umituz/react-native-design-system/atoms";
|
|
13
13
|
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
14
|
+
import { devWarn } from "../../../../utils/devUtils";
|
|
14
15
|
import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
|
|
15
16
|
import { FeedbackModal } from "../components/FeedbackModal";
|
|
16
17
|
import { ICON_PATHS } from "../../../../utils/iconPaths";
|
|
@@ -66,7 +67,7 @@ export const FeatureRequestScreen: React.FC<FeatureRequestScreenProps> = ({ conf
|
|
|
66
67
|
});
|
|
67
68
|
setIsModalVisible(false);
|
|
68
69
|
} catch (error) {
|
|
69
|
-
|
|
70
|
+
devWarn("[FeatureRequestScreen] Submit failed:", error);
|
|
70
71
|
} finally {
|
|
71
72
|
setIsSubmitting(false);
|
|
72
73
|
}
|
|
@@ -146,8 +147,6 @@ export const FeatureRequestScreen: React.FC<FeatureRequestScreenProps> = ({ conf
|
|
|
146
147
|
);
|
|
147
148
|
}, [userVotes, vote, tokens.colors, getStatusColor, statusLabels, t]);
|
|
148
149
|
|
|
149
|
-
const keyExtractor = useCallback((item: FeatureRequestItem) => item.id, []);
|
|
150
|
-
|
|
151
150
|
const tabs = useMemo(() => (['all', 'my', 'roadmap'] as const), []);
|
|
152
151
|
|
|
153
152
|
const header = useMemo(() => (
|