@umituz/react-native-settings 4.20.42 → 4.20.44

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": "4.20.42",
3
+ "version": "4.20.44",
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",
@@ -2,9 +2,6 @@
2
2
  * @umituz/react-native-faqs - Components
3
3
  */
4
4
 
5
- export { FAQSection } from './FAQSection';
6
- export type { FAQSectionProps, FAQConfig } from './FAQSection';
7
-
8
5
  export { FAQItemComponent } from './FAQItem';
9
6
  export type { FAQItemProps } from './FAQItem';
10
7
 
@@ -68,34 +68,33 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
68
68
  return Wrapper;
69
69
  }, [config, appInfo.version, showUserProfile, userProfile, devSettings, customSections]);
70
70
 
71
- const NotificationSettingsWrapper = useMemo(() => {
72
- const Wrapper = () => (
73
- <NotificationSettingsScreen
74
- translations={{
75
- screenTitle: t("settings.notifications.title"),
76
- masterToggleTitle: t("settings.notifications.masterToggleTitle"),
77
- masterToggleDescription: t("settings.notifications.masterToggleDescription"),
78
- soundTitle: t("settings.notifications.soundTitle"),
79
- soundDescription: t("settings.notifications.soundDescription"),
80
- vibrationTitle: t("settings.notifications.vibrationTitle"),
81
- vibrationDescription: t("settings.notifications.vibrationDescription"),
82
- remindersTitle: t("settings.notifications.remindersTitle"),
83
- remindersDescription: t("settings.notifications.remindersDescription"),
84
- quietHoursTitle: t("settings.notifications.quietHoursTitle"),
85
- quietHoursDescription: t("settings.notifications.quietHoursDescription"),
86
- }}
87
- quietHoursTranslations={{
88
- title: t("settings.notifications.quietHours.title"),
89
- description: t("settings.notifications.quietHours.description"),
90
- startTimeLabel: t("settings.notifications.quietHours.startTimeLabel"),
91
- endTimeLabel: t("settings.notifications.quietHours.endTimeLabel"),
92
- enabledLabel: t("settings.notifications.quietHours.enabledLabel"),
93
- }}
94
- />
95
- );
96
- Wrapper.displayName = "NotificationSettingsWrapper";
97
- return Wrapper;
98
- }, [t]);
71
+ const notificationTranslations = useMemo(
72
+ () => ({
73
+ screenTitle: t("settings.notifications.title"),
74
+ masterToggleTitle: t("settings.notifications.masterToggleTitle"),
75
+ masterToggleDescription: t("settings.notifications.masterToggleDescription"),
76
+ soundTitle: t("settings.notifications.soundTitle"),
77
+ soundDescription: t("settings.notifications.soundDescription"),
78
+ vibrationTitle: t("settings.notifications.vibrationTitle"),
79
+ vibrationDescription: t("settings.notifications.vibrationDescription"),
80
+ remindersTitle: t("settings.notifications.remindersTitle"),
81
+ remindersDescription: t("settings.notifications.remindersDescription"),
82
+ quietHoursTitle: t("settings.notifications.quietHoursTitle"),
83
+ quietHoursDescription: t("settings.notifications.quietHoursDescription"),
84
+ }),
85
+ [t]
86
+ );
87
+
88
+ const quietHoursTranslations = useMemo(
89
+ () => ({
90
+ title: t("settings.notifications.quietHours.title"),
91
+ description: t("settings.notifications.quietHours.description"),
92
+ startTimeLabel: t("settings.notifications.quietHours.startTimeLabel"),
93
+ endTimeLabel: t("settings.notifications.quietHours.endTimeLabel"),
94
+ enabledLabel: t("settings.notifications.quietHours.enabledLabel"),
95
+ }),
96
+ [t]
97
+ );
99
98
 
100
99
  const LegalScreenWrapper = useMemo(() => {
101
100
  const Wrapper = () => (
@@ -164,13 +163,19 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
164
163
 
165
164
  <Stack.Screen
166
165
  name="Notifications"
167
- component={NotificationSettingsWrapper}
168
166
  options={{
169
167
  headerShown: true,
170
168
  headerTitle: t("settings.notifications.title"),
171
169
  headerTitleAlign: "center",
172
170
  }}
173
- />
171
+ >
172
+ {() => (
173
+ <NotificationSettingsScreen
174
+ translations={notificationTranslations}
175
+ quietHoursTranslations={quietHoursTranslations}
176
+ />
177
+ )}
178
+ </Stack.Screen>
174
179
 
175
180
  {faqData && faqData.categories.length > 0 && (
176
181
  <Stack.Screen
@@ -1,53 +0,0 @@
1
- /**
2
- * FAQ Section Component
3
- * Renders FAQ entry point for settings
4
- */
5
-
6
- import React from 'react';
7
- import { AtomicIcon } from '@umituz/react-native-design-system';
8
-
9
- export interface FAQConfig {
10
- enabled?: boolean;
11
- title?: string;
12
- description?: string;
13
- onPress?: () => void;
14
- }
15
-
16
- export interface FAQSectionProps {
17
- config: FAQConfig;
18
- renderSection: (props: {
19
- title: string;
20
- children: React.ReactNode;
21
- }) => React.ReactElement | null;
22
- renderItem: (props: {
23
- title: string;
24
- icon: any;
25
- onPress: () => void;
26
- isLast?: boolean;
27
- }) => React.ReactElement | null;
28
- }
29
-
30
- export const FAQSection: React.FC<FAQSectionProps> = ({
31
- config,
32
- renderSection,
33
- renderItem,
34
- }) => {
35
- // onPress is required for FAQ section to be functional
36
- if (!config.enabled || !config.title || !config.description || !config.onPress) {
37
- return null;
38
- }
39
-
40
- return (
41
- <>
42
- {renderSection({
43
- title: config.title,
44
- children: renderItem({
45
- title: config.description,
46
- icon: 'help-circle',
47
- onPress: config.onPress,
48
- isLast: true,
49
- }),
50
- })}
51
- </>
52
- );
53
- };