@umituz/react-native-settings 5.4.11 → 5.4.12
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.4.
|
|
3
|
+
"version": "5.4.12",
|
|
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",
|
|
@@ -8,7 +8,6 @@ import React, { useCallback } from "react";
|
|
|
8
8
|
import { Linking } from "react-native";
|
|
9
9
|
import { useAppNavigation } from "@umituz/react-native-design-system/molecules";
|
|
10
10
|
import type { FeedbackType } from "../../domain/entities/FeedbackEntity";
|
|
11
|
-
import { isDev } from "../../../../utils/devUtils";
|
|
12
11
|
|
|
13
12
|
export interface FeedbackConfig {
|
|
14
13
|
enabled?: boolean;
|
|
@@ -11,12 +11,12 @@ 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 { useAppNavigation } from "@umituz/react-native-design-system/molecules";
|
|
14
15
|
import { devWarn } from "../../../../utils/devUtils";
|
|
15
16
|
import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
|
|
16
|
-
import { FeedbackModal } from "../components/FeedbackModal";
|
|
17
17
|
import { ICON_PATHS } from "../../../../utils/iconPaths";
|
|
18
18
|
import { useFeatureRequests } from "../../infrastructure/useFeatureRequests";
|
|
19
|
-
import type { FeedbackType
|
|
19
|
+
import type { FeedbackType } from "../../domain/entities/FeedbackEntity";
|
|
20
20
|
import type { FeatureRequestItem } from "../../domain/entities/FeatureRequestEntity";
|
|
21
21
|
import type { FeedbackFormTexts } from "../components/FeedbackFormProps";
|
|
22
22
|
|
|
@@ -29,11 +29,10 @@ interface FeatureRequestScreenProps {
|
|
|
29
29
|
|
|
30
30
|
export const FeatureRequestScreen: React.FC<FeatureRequestScreenProps> = ({ config, texts }) => {
|
|
31
31
|
const tokens = useAppDesignTokens();
|
|
32
|
+
const navigation = useAppNavigation();
|
|
32
33
|
const { requests, userVotes, isLoading, vote, submitRequest, userId } = useFeatureRequests();
|
|
33
34
|
|
|
34
35
|
const [activeTab, setActiveTab] = useState<'all' | 'my' | 'roadmap'>('all');
|
|
35
|
-
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
36
|
-
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
37
36
|
|
|
38
37
|
const t = config?.translations || {};
|
|
39
38
|
const screenTitle = t.screen_title || "Feedback & Features";
|
|
@@ -56,23 +55,6 @@ export const FeatureRequestScreen: React.FC<FeatureRequestScreenProps> = ({ conf
|
|
|
56
55
|
dismissed: t.status?.dismissed || "Dismissed",
|
|
57
56
|
};
|
|
58
57
|
|
|
59
|
-
const handleSubmit = useCallback(async (data: { title?: string; description: string; type?: string; rating?: number }) => {
|
|
60
|
-
setIsSubmitting(true);
|
|
61
|
-
try {
|
|
62
|
-
await submitRequest({
|
|
63
|
-
title: data.title || "New Request",
|
|
64
|
-
description: data.description,
|
|
65
|
-
type: (data.type || "feature_request") as FeedbackType,
|
|
66
|
-
rating: data.rating as FeedbackRating,
|
|
67
|
-
});
|
|
68
|
-
setIsModalVisible(false);
|
|
69
|
-
} catch (error) {
|
|
70
|
-
devWarn("[FeatureRequestScreen] Submit failed:", error);
|
|
71
|
-
} finally {
|
|
72
|
-
setIsSubmitting(false);
|
|
73
|
-
}
|
|
74
|
-
}, [submitRequest]);
|
|
75
|
-
|
|
76
58
|
const getStatusColor = (status: string) => {
|
|
77
59
|
switch (status) {
|
|
78
60
|
case 'planned': return '#3b82f6';
|
|
@@ -154,7 +136,11 @@ export const FeatureRequestScreen: React.FC<FeatureRequestScreenProps> = ({ conf
|
|
|
154
136
|
<AtomicText style={styles.headerTitle}>{screenTitle}</AtomicText>
|
|
155
137
|
<TouchableOpacity
|
|
156
138
|
style={[styles.addButton, { backgroundColor: tokens.colors.primary }]}
|
|
157
|
-
onPress={() =>
|
|
139
|
+
onPress={() => navigation.push('Feedback' as never, {
|
|
140
|
+
initialType: 'feature_request' as FeedbackType,
|
|
141
|
+
title: texts?.title,
|
|
142
|
+
texts: texts,
|
|
143
|
+
})}
|
|
158
144
|
>
|
|
159
145
|
<AtomicIcon
|
|
160
146
|
svgPath={ICON_PATHS['plus']}
|
|
@@ -236,22 +222,14 @@ export const FeatureRequestScreen: React.FC<FeatureRequestScreenProps> = ({ conf
|
|
|
236
222
|
windowSize={5}
|
|
237
223
|
/>
|
|
238
224
|
|
|
239
|
-
{isModalVisible && (
|
|
240
|
-
<FeedbackModal
|
|
241
|
-
visible={isModalVisible}
|
|
242
|
-
onClose={() => setIsModalVisible(false)}
|
|
243
|
-
title={texts?.title}
|
|
244
|
-
onSubmit={handleSubmit}
|
|
245
|
-
texts={texts}
|
|
246
|
-
initialType="feature_request"
|
|
247
|
-
isSubmitting={isSubmitting}
|
|
248
|
-
/>
|
|
249
|
-
)}
|
|
250
|
-
|
|
251
225
|
<View style={styles.floatingHint}>
|
|
252
226
|
<TouchableOpacity
|
|
253
227
|
style={[styles.hintBadge, { backgroundColor: tokens.colors.primary }]}
|
|
254
|
-
onPress={() =>
|
|
228
|
+
onPress={() => navigation.push('Feedback' as never, {
|
|
229
|
+
initialType: 'feature_request' as FeedbackType,
|
|
230
|
+
title: texts?.title,
|
|
231
|
+
texts: texts,
|
|
232
|
+
})}
|
|
255
233
|
>
|
|
256
234
|
<AtomicText style={styles.hintText}>{newIdeaLabel}</AtomicText>
|
|
257
235
|
</TouchableOpacity>
|