@umituz/react-native-settings 4.17.17 → 4.17.19
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 +4 -2
- package/src/domains/appearance/index.ts +3 -1
- package/src/domains/appearance/presentation/screens/AppearanceScreen.tsx +2 -1
- package/src/domains/faqs/index.ts +4 -2
- package/src/domains/feedback/index.ts +6 -1
- package/src/domains/legal/__tests__/setup.ts +1 -1
- package/src/presentation/screens/AppearanceScreen.tsx +2 -5
- package/src/presentation/screens/components/SettingsContent.tsx +4 -5
- package/src/presentation/screens/types/FeatureConfig.ts +1 -1
- package/src/domains/feedback/presentation/hooks/useDeleteFeedback.ts +0 -25
- package/src/domains/feedback/presentation/hooks/useSubmitFeedback.ts +0 -55
- package/src/domains/feedback/presentation/hooks/useUserFeedback.ts +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.19",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, and rating",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
55
55
|
"@expo/vector-icons": "^15.0.0",
|
|
56
|
+
"@react-navigation/native": "^6.1.18",
|
|
57
|
+
"@react-navigation/stack": "^6.4.1",
|
|
56
58
|
"@types/jest": "^29.5.14",
|
|
57
59
|
"@types/react": "~19.1.10",
|
|
58
60
|
"@umituz/react-native-auth": "latest",
|
|
@@ -75,6 +77,6 @@
|
|
|
75
77
|
"LICENSE"
|
|
76
78
|
],
|
|
77
79
|
"dependencies": {
|
|
78
|
-
"@umituz/react-native-design-system": "
|
|
80
|
+
"@umituz/react-native-design-system": "latest"
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
ThemeModeSection,
|
|
15
15
|
CustomColorsSection,
|
|
16
16
|
AppearancePreview,
|
|
17
|
+
type ThemeOptionConfig,
|
|
17
18
|
} from "../components";
|
|
18
19
|
|
|
19
20
|
import type { AppearanceTexts } from "../../types";
|
|
@@ -101,7 +102,7 @@ export const AppearanceScreen: React.FC<AppearanceScreenProps> = ({
|
|
|
101
102
|
|
|
102
103
|
// Construct themes from texts prop
|
|
103
104
|
// This adheres to "Package Driven Design" where content is driven by the consumer (App)
|
|
104
|
-
const themes = [];
|
|
105
|
+
const themes: ThemeOptionConfig[] = [];
|
|
105
106
|
|
|
106
107
|
// We only add the theme option if the corresponding text config is provided
|
|
107
108
|
if (texts?.lightMode) {
|
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
* Frequently asked questions
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export * from './presentation/screens/
|
|
7
|
-
export * from './presentation/components
|
|
6
|
+
export * from './presentation/screens/FAQScreen';
|
|
7
|
+
export * from './presentation/components';
|
|
8
|
+
export * from './presentation/hooks';
|
|
9
|
+
export * from './domain/entities/FAQEntity';
|
|
@@ -3,4 +3,9 @@
|
|
|
3
3
|
* User feedback, bug reports
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export * from './presentation/
|
|
6
|
+
export * from './presentation/components/FeedbackForm';
|
|
7
|
+
export * from './presentation/components/FeedbackModal';
|
|
8
|
+
export * from './presentation/components/SupportSection';
|
|
9
|
+
export * from './presentation/hooks/useFeedbackForm';
|
|
10
|
+
export * from './domain/entities/FeedbackEntity';
|
|
11
|
+
export * from './domain/repositories/IFeedbackRepository';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Appearance Settings Screen
|
|
3
3
|
* Advanced appearance settings with theme customization and custom colors
|
|
4
|
-
*
|
|
4
|
+
* Now uses consolidated appearance domain
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import { AppearanceScreen } from "@umituz/react-native-appearance";
|
|
9
|
-
|
|
10
|
-
export { AppearanceScreen };
|
|
7
|
+
export { AppearanceScreen } from "@domains/appearance/presentation/screens/AppearanceScreen";
|
|
@@ -13,11 +13,11 @@ import { ProfileSection } from "@umituz/react-native-auth";
|
|
|
13
13
|
import { SettingsSection } from "../../components/SettingsSection";
|
|
14
14
|
import { DevSettingsSection, DevSettingsProps } from "../../components/DevSettingsSection";
|
|
15
15
|
import { NotificationsSection } from "@umituz/react-native-notifications";
|
|
16
|
-
import { AboutSection } from "@
|
|
17
|
-
import { LegalSection } from "@
|
|
18
|
-
import { AppearanceSection } from "@
|
|
16
|
+
import { AboutSection } from "@domains/about/presentation/components/AboutSection";
|
|
17
|
+
import { LegalSection } from "@domains/legal/presentation/components/LegalSection";
|
|
18
|
+
import { AppearanceSection } from "@domains/appearance/presentation/components/AppearanceSection";
|
|
19
19
|
import { LanguageSection } from "@umituz/react-native-localization";
|
|
20
|
-
import { SupportSection } from "@
|
|
20
|
+
import { SupportSection } from "@domains/feedback/presentation/components/SupportSection";
|
|
21
21
|
import { SettingItem } from "../../components/SettingItem";
|
|
22
22
|
import type { NormalizedConfig } from "../utils/normalizeConfig";
|
|
23
23
|
import type { CustomSettingsSection } from "../types";
|
|
@@ -190,7 +190,6 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
190
190
|
normalizedConfig.language.config?.description ||
|
|
191
191
|
t("settings.languageSelection.description"),
|
|
192
192
|
}}
|
|
193
|
-
sectionTitle={t("settings.languageSelection.title")}
|
|
194
193
|
/>
|
|
195
194
|
)}
|
|
196
195
|
|
|
@@ -197,7 +197,7 @@ export interface SubscriptionConfig {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
import type { FeedbackType } from "@
|
|
200
|
+
import type { FeedbackType } from "@domains/feedback/domain/entities/FeedbackEntity";
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
203
|
* Feedback Settings Configuration
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Delete Feedback Hook
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import type { IFeedbackRepository } from '../../domain/repositories/IFeedbackRepository';
|
|
7
|
-
|
|
8
|
-
export function useDeleteFeedback(repository: IFeedbackRepository) {
|
|
9
|
-
const queryClient = useQueryClient();
|
|
10
|
-
|
|
11
|
-
return useMutation({
|
|
12
|
-
mutationFn: async (feedbackId: string) => {
|
|
13
|
-
const result = await repository.deleteFeedback(feedbackId);
|
|
14
|
-
|
|
15
|
-
if (!result.success) {
|
|
16
|
-
throw new Error(result.error.message);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return result.data;
|
|
20
|
-
},
|
|
21
|
-
onSuccess: () => {
|
|
22
|
-
queryClient.invalidateQueries({ queryKey: ['feedback'] });
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Submit Feedback Hook
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import type { IFeedbackRepository } from '../../domain/repositories/IFeedbackRepository';
|
|
7
|
-
import {
|
|
8
|
-
createFeedback,
|
|
9
|
-
type FeedbackType,
|
|
10
|
-
} from '../../domain/entities/FeedbackEntity';
|
|
11
|
-
|
|
12
|
-
interface SubmitFeedbackParams {
|
|
13
|
-
userId: string | null;
|
|
14
|
-
userEmail?: string | null;
|
|
15
|
-
type: FeedbackType;
|
|
16
|
-
title: string;
|
|
17
|
-
description: string;
|
|
18
|
-
rating?: 1 | 2 | 3 | 4 | 5;
|
|
19
|
-
deviceInfo?: {
|
|
20
|
-
platform: string;
|
|
21
|
-
osVersion: string;
|
|
22
|
-
appVersion: string;
|
|
23
|
-
};
|
|
24
|
-
metadata?: Record<string, unknown>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function useSubmitFeedback(repository: IFeedbackRepository) {
|
|
28
|
-
const queryClient = useQueryClient();
|
|
29
|
-
|
|
30
|
-
return useMutation({
|
|
31
|
-
mutationFn: async (params: SubmitFeedbackParams) => {
|
|
32
|
-
const feedback = createFeedback(
|
|
33
|
-
params.userId,
|
|
34
|
-
params.type,
|
|
35
|
-
params.title,
|
|
36
|
-
params.description,
|
|
37
|
-
params.userEmail,
|
|
38
|
-
params.rating,
|
|
39
|
-
params.deviceInfo,
|
|
40
|
-
params.metadata
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const result = await repository.submitFeedback(feedback);
|
|
44
|
-
|
|
45
|
-
if (!result.success) {
|
|
46
|
-
throw new Error(result.error.message);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return result.data;
|
|
50
|
-
},
|
|
51
|
-
onSuccess: () => {
|
|
52
|
-
queryClient.invalidateQueries({ queryKey: ['feedback'] });
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User Feedback Hook
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { useQuery } from '@tanstack/react-query';
|
|
6
|
-
import type { IFeedbackRepository } from '../../domain/repositories/IFeedbackRepository';
|
|
7
|
-
|
|
8
|
-
export function useUserFeedback(
|
|
9
|
-
repository: IFeedbackRepository,
|
|
10
|
-
userId: string | null
|
|
11
|
-
) {
|
|
12
|
-
return useQuery({
|
|
13
|
-
queryKey: ['feedback', userId],
|
|
14
|
-
queryFn: async () => {
|
|
15
|
-
if (!userId) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const result = await repository.getUserFeedback(userId);
|
|
20
|
-
|
|
21
|
-
if (!result.success) {
|
|
22
|
-
throw new Error(result.error.message);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return result.data;
|
|
26
|
-
},
|
|
27
|
-
enabled: !!userId,
|
|
28
|
-
});
|
|
29
|
-
}
|