@umituz/react-native-settings 4.16.7 → 4.16.10
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 +3 -1
- package/src/presentation/screens/components/SettingsContent.tsx +17 -0
- package/src/presentation/screens/hooks/useFeatureDetection.ts +2 -0
- package/src/presentation/screens/types/FeatureConfig.ts +13 -0
- package/src/presentation/screens/types/SettingsConfig.ts +6 -0
- package/src/presentation/screens/types/index.ts +1 -0
- package/src/presentation/screens/utils/normalizeConfig.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.10",
|
|
4
4
|
"description": "Settings management for React Native apps - user preferences, theme, language, notifications",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@umituz/react-native-design-system-theme": "*",
|
|
41
41
|
"@umituz/react-native-design-system-typography": "*",
|
|
42
42
|
"@umituz/react-native-exception": "latest",
|
|
43
|
+
"@umituz/react-native-faqs": "^1.0.1",
|
|
43
44
|
"@umituz/react-native-feedback": "^1.3.0",
|
|
44
45
|
"@umituz/react-native-legal": "*",
|
|
45
46
|
"@umituz/react-native-localization": "*",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
"@umituz/react-native-design-system-responsive": "latest",
|
|
78
79
|
"@umituz/react-native-design-system-theme": "latest",
|
|
79
80
|
"@umituz/react-native-design-system-typography": "latest",
|
|
81
|
+
"@umituz/react-native-faqs": "latest",
|
|
80
82
|
"@umituz/react-native-feedback": "^1.3.0",
|
|
81
83
|
"@umituz/react-native-legal": "^2.0.3",
|
|
82
84
|
"@umituz/react-native-localization": "latest",
|
|
@@ -18,6 +18,7 @@ import { LegalSection } from "@umituz/react-native-legal";
|
|
|
18
18
|
import { AppearanceSection } from "@umituz/react-native-appearance";
|
|
19
19
|
import { LanguageSection } from "@umituz/react-native-localization";
|
|
20
20
|
import { SupportSection } from "@umituz/react-native-feedback";
|
|
21
|
+
import { FAQSection } from "@umituz/react-native-faqs";
|
|
21
22
|
import { SettingItem } from "../../components/SettingItem";
|
|
22
23
|
import type { NormalizedConfig } from "../utils/normalizeConfig";
|
|
23
24
|
import type { CustomSettingsSection } from "../types";
|
|
@@ -60,6 +61,7 @@ interface SettingsContentProps {
|
|
|
60
61
|
subscription: boolean;
|
|
61
62
|
feedback: boolean;
|
|
62
63
|
rating: boolean;
|
|
64
|
+
faqs: boolean;
|
|
63
65
|
};
|
|
64
66
|
showUserProfile?: boolean;
|
|
65
67
|
userProfile?: {
|
|
@@ -107,6 +109,8 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
107
109
|
features.disclaimer ||
|
|
108
110
|
features.subscription ||
|
|
109
111
|
features.feedback ||
|
|
112
|
+
features.rating ||
|
|
113
|
+
features.faqs ||
|
|
110
114
|
customSections.length > 0,
|
|
111
115
|
[features, customSections.length]
|
|
112
116
|
);
|
|
@@ -243,6 +247,19 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
243
247
|
/>
|
|
244
248
|
)}
|
|
245
249
|
|
|
250
|
+
{features.faqs && (
|
|
251
|
+
<FAQSection
|
|
252
|
+
renderSection={(props: any) => <SettingsSection {...props} />}
|
|
253
|
+
renderItem={(props: any) => <SettingItem {...props} />}
|
|
254
|
+
config={{
|
|
255
|
+
enabled: features.faqs,
|
|
256
|
+
...normalizedConfig.faqs.config,
|
|
257
|
+
title: normalizedConfig.faqs.config?.title || t("settings.support.title") || "Support",
|
|
258
|
+
description: normalizedConfig.faqs.config?.description || t("settings.faqs.description") || "FAQs",
|
|
259
|
+
}}
|
|
260
|
+
/>
|
|
261
|
+
)}
|
|
262
|
+
|
|
246
263
|
{features.disclaimer && DisclaimerSetting && (
|
|
247
264
|
<DisclaimerSetting />
|
|
248
265
|
)}
|
|
@@ -72,6 +72,7 @@ export function useFeatureDetection(
|
|
|
72
72
|
subscription,
|
|
73
73
|
feedback,
|
|
74
74
|
rating,
|
|
75
|
+
faqs,
|
|
75
76
|
} = normalizedConfig;
|
|
76
77
|
|
|
77
78
|
const notificationServiceAvailable =
|
|
@@ -127,6 +128,7 @@ export function useFeatureDetection(
|
|
|
127
128
|
subscription.config?.sectionConfig !== undefined,
|
|
128
129
|
feedback: feedback.enabled,
|
|
129
130
|
rating: rating.enabled,
|
|
131
|
+
faqs: faqs.enabled,
|
|
130
132
|
};
|
|
131
133
|
}, [normalizedConfig, navigation, options]);
|
|
132
134
|
}
|
|
@@ -187,6 +187,19 @@ export interface FeedbackConfig {
|
|
|
187
187
|
onSubmit?: (data: { type: any; rating: number; description: string; title: string }) => Promise<void>;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
export interface FAQConfig {
|
|
191
|
+
/** Enable FAQ feature */
|
|
192
|
+
enabled?: boolean;
|
|
193
|
+
/** Custom title for the FAQ section */
|
|
194
|
+
title?: string;
|
|
195
|
+
/** Custom label for the FAQ button */
|
|
196
|
+
description?: string;
|
|
197
|
+
/** FAQ items passed from app */
|
|
198
|
+
items?: any[];
|
|
199
|
+
/** Handler to open FAQ screen */
|
|
200
|
+
onPress?: () => void;
|
|
201
|
+
}
|
|
202
|
+
|
|
190
203
|
export interface RatingConfig {
|
|
191
204
|
/** Enable rating feature */
|
|
192
205
|
enabled?: boolean;
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
SubscriptionConfig,
|
|
16
16
|
FeedbackConfig,
|
|
17
17
|
RatingConfig,
|
|
18
|
+
FAQConfig,
|
|
18
19
|
} from "./FeatureConfig";
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -109,6 +110,11 @@ export interface SettingsConfig {
|
|
|
109
110
|
*/
|
|
110
111
|
rating?: FeatureVisibility | RatingConfig;
|
|
111
112
|
|
|
113
|
+
/**
|
|
114
|
+
* FAQ settings configuration
|
|
115
|
+
*/
|
|
116
|
+
faqs?: FeatureVisibility | FAQConfig;
|
|
117
|
+
|
|
112
118
|
/**
|
|
113
119
|
* Custom empty state text when no settings are available
|
|
114
120
|
*/
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
SubscriptionConfig,
|
|
16
16
|
FeedbackConfig,
|
|
17
17
|
RatingConfig,
|
|
18
|
+
FAQConfig,
|
|
18
19
|
SettingsConfig,
|
|
19
20
|
} from "../types";
|
|
20
21
|
|
|
@@ -59,6 +60,10 @@ export interface NormalizedConfig {
|
|
|
59
60
|
enabled: boolean;
|
|
60
61
|
config?: RatingConfig;
|
|
61
62
|
};
|
|
63
|
+
faqs: {
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
config?: FAQConfig;
|
|
66
|
+
};
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
/**
|
|
@@ -103,6 +108,7 @@ export function normalizeSettingsConfig(
|
|
|
103
108
|
subscription: normalizeConfigValue(config?.subscription, false),
|
|
104
109
|
feedback: normalizeConfigValue(config?.feedback, false),
|
|
105
110
|
rating: normalizeConfigValue(config?.rating, false),
|
|
111
|
+
faqs: normalizeConfigValue(config?.faqs, false),
|
|
106
112
|
};
|
|
107
113
|
}
|
|
108
114
|
|