@umituz/react-native-settings 4.23.82 → 4.23.84
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/disclaimer/presentation/screens/DisclaimerScreen.tsx +15 -1
- package/src/domains/faqs/presentation/screens/FAQScreen.tsx +25 -23
- package/src/domains/feedback/presentation/components/FeedbackForm.styles.ts +51 -0
- package/src/domains/feedback/presentation/components/FeedbackForm.tsx +3 -49
- package/src/domains/feedback/presentation/components/FeedbackModal.tsx +16 -19
- package/src/domains/gamification/components/GamificationScreen/GamificationScreen.tsx +54 -57
- package/src/domains/legal/presentation/screens/LegalContentScreen.tsx +8 -8
- package/src/domains/legal/presentation/screens/LegalScreen.tsx +14 -3
- package/src/domains/notifications/index.ts +1 -1
- package/src/domains/notifications/presentation/screens/NotificationsScreen.tsx +53 -26
- package/src/domains/notifications/reminders/presentation/components/ReminderForm.constants.ts +35 -0
- package/src/domains/notifications/reminders/presentation/components/ReminderForm.styles.ts +22 -0
- package/src/domains/notifications/reminders/presentation/components/ReminderForm.tsx +13 -57
- package/src/domains/notifications/reminders/presentation/screens/ReminderListScreen.tsx +25 -10
- package/src/domains/video-tutorials/presentation/components/VideoTutorialCard.tsx +17 -14
- package/src/domains/video-tutorials/presentation/screens/VideoTutorialsScreen.tsx +58 -33
- package/src/presentation/components/SettingsFooter.tsx +3 -3
- package/src/presentation/navigation/SettingsStackNavigator.tsx +32 -174
- package/src/presentation/navigation/hooks/index.ts +1 -0
- package/src/presentation/navigation/hooks/useSettingsScreens.ts +163 -0
- package/src/presentation/screens/SettingsScreen.tsx +0 -1
- package/src/presentation/screens/components/SettingsHeader.tsx +2 -5
- package/src/utils/appUtils.ts +7 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import type { StackScreen } from "@umituz/react-native-design-system";
|
|
3
|
+
import { LanguageSelectionScreen } from "../../../domains/localization";
|
|
4
|
+
import { NotificationSettingsScreen } from "../../../domains/notifications";
|
|
5
|
+
import { AccountScreen } from "@umituz/react-native-auth";
|
|
6
|
+
import { SettingsScreen } from "../../screens/SettingsScreen";
|
|
7
|
+
import { AppearanceScreen } from "../../screens/AppearanceScreen";
|
|
8
|
+
import { FAQScreen } from "../../../domains/faqs";
|
|
9
|
+
import { AboutScreen } from "../../../domains/about";
|
|
10
|
+
import { LegalScreen } from "../../../domains/legal";
|
|
11
|
+
import { GamificationScreen } from "../../../domains/gamification";
|
|
12
|
+
import type { SettingsStackNavigatorProps, AdditionalScreen } from "../types";
|
|
13
|
+
|
|
14
|
+
export interface UseSettingsScreensProps extends SettingsStackNavigatorProps {
|
|
15
|
+
aboutConfig: any;
|
|
16
|
+
legalProps: any;
|
|
17
|
+
notificationTranslations: any;
|
|
18
|
+
quietHoursTranslations: any;
|
|
19
|
+
t: (key: string) => string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const useSettingsScreens = (props: UseSettingsScreensProps): StackScreen[] => {
|
|
23
|
+
const {
|
|
24
|
+
appInfo,
|
|
25
|
+
config,
|
|
26
|
+
showUserProfile,
|
|
27
|
+
userProfile,
|
|
28
|
+
devSettings,
|
|
29
|
+
customSections,
|
|
30
|
+
showHeader,
|
|
31
|
+
showCloseButton,
|
|
32
|
+
onClose,
|
|
33
|
+
aboutConfig,
|
|
34
|
+
legalProps,
|
|
35
|
+
notificationTranslations,
|
|
36
|
+
quietHoursTranslations,
|
|
37
|
+
faqData,
|
|
38
|
+
additionalScreens,
|
|
39
|
+
gamificationConfig,
|
|
40
|
+
accountConfig,
|
|
41
|
+
t,
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
return useMemo(() => {
|
|
45
|
+
const baseScreens: StackScreen[] = [
|
|
46
|
+
{
|
|
47
|
+
name: "SettingsMain",
|
|
48
|
+
options: { headerShown: false },
|
|
49
|
+
children: () => React.createElement(SettingsScreen, {
|
|
50
|
+
config,
|
|
51
|
+
appVersion: appInfo.version,
|
|
52
|
+
showUserProfile,
|
|
53
|
+
userProfile,
|
|
54
|
+
devSettings,
|
|
55
|
+
customSections,
|
|
56
|
+
showHeader,
|
|
57
|
+
showCloseButton,
|
|
58
|
+
onClose,
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "Appearance",
|
|
63
|
+
component: AppearanceScreen as any,
|
|
64
|
+
options: { headerShown: false },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "About",
|
|
68
|
+
options: { headerShown: false },
|
|
69
|
+
children: () => React.createElement(AboutScreen, { config: aboutConfig }),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "Legal",
|
|
73
|
+
options: { headerShown: false },
|
|
74
|
+
children: () => React.createElement(LegalScreen, legalProps),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "Notifications",
|
|
78
|
+
options: { headerShown: false },
|
|
79
|
+
children: () => React.createElement(NotificationSettingsScreen, {
|
|
80
|
+
translations: notificationTranslations,
|
|
81
|
+
quietHoursTranslations,
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
const faqScreen: StackScreen | null = (faqData && faqData.categories?.length > 0)
|
|
87
|
+
? {
|
|
88
|
+
name: "FAQ",
|
|
89
|
+
options: { headerShown: false },
|
|
90
|
+
children: () => React.createElement(FAQScreen, {
|
|
91
|
+
categories: faqData.categories,
|
|
92
|
+
searchPlaceholder: t("settings.faqs.searchPlaceholder"),
|
|
93
|
+
emptySearchTitle: t("settings.faqs.emptySearchTitle"),
|
|
94
|
+
emptySearchMessage: t("settings.faqs.emptySearchMessage"),
|
|
95
|
+
headerTitle: t("settings.faqs.headerTitle"),
|
|
96
|
+
}),
|
|
97
|
+
}
|
|
98
|
+
: null;
|
|
99
|
+
|
|
100
|
+
const additionalStackScreens: StackScreen[] = (additionalScreens || []).map((screen: AdditionalScreen): StackScreen => {
|
|
101
|
+
const stackScreen: any = { name: screen.name };
|
|
102
|
+
if (screen.component) stackScreen.component = screen.component;
|
|
103
|
+
if (screen.children) stackScreen.children = screen.children;
|
|
104
|
+
if (screen.options) stackScreen.options = screen.options;
|
|
105
|
+
return stackScreen as StackScreen;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const gamificationScreen: StackScreen | null = gamificationConfig?.enabled
|
|
109
|
+
? {
|
|
110
|
+
name: "Gamification",
|
|
111
|
+
options: { headerShown: false },
|
|
112
|
+
children: () => React.createElement(GamificationScreen, { config: gamificationConfig }),
|
|
113
|
+
}
|
|
114
|
+
: null;
|
|
115
|
+
|
|
116
|
+
const languageScreen: StackScreen = {
|
|
117
|
+
name: "LanguageSelection",
|
|
118
|
+
options: { headerShown: false },
|
|
119
|
+
children: () => React.createElement(LanguageSelectionScreen, {
|
|
120
|
+
headerTitle: t("settings.language.title"),
|
|
121
|
+
searchPlaceholder: t("settings.languageSelection.searchPlaceholder"),
|
|
122
|
+
}),
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const accountScreen: StackScreen | null = accountConfig
|
|
126
|
+
? {
|
|
127
|
+
name: "Account",
|
|
128
|
+
options: { headerShown: false },
|
|
129
|
+
children: () => React.createElement(AccountScreen, { config: accountConfig }),
|
|
130
|
+
}
|
|
131
|
+
: null;
|
|
132
|
+
|
|
133
|
+
const allScreens: StackScreen[] = [
|
|
134
|
+
...baseScreens,
|
|
135
|
+
...(faqScreen ? [faqScreen] : []),
|
|
136
|
+
...additionalStackScreens,
|
|
137
|
+
...(gamificationScreen ? [gamificationScreen] : []),
|
|
138
|
+
languageScreen,
|
|
139
|
+
...(accountScreen ? [accountScreen] : []),
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
return allScreens;
|
|
143
|
+
}, [
|
|
144
|
+
t,
|
|
145
|
+
showHeader,
|
|
146
|
+
showCloseButton,
|
|
147
|
+
onClose,
|
|
148
|
+
config,
|
|
149
|
+
appInfo.version,
|
|
150
|
+
showUserProfile,
|
|
151
|
+
userProfile,
|
|
152
|
+
devSettings,
|
|
153
|
+
customSections,
|
|
154
|
+
aboutConfig,
|
|
155
|
+
legalProps,
|
|
156
|
+
notificationTranslations,
|
|
157
|
+
quietHoursTranslations,
|
|
158
|
+
faqData,
|
|
159
|
+
additionalScreens,
|
|
160
|
+
gamificationConfig,
|
|
161
|
+
accountConfig,
|
|
162
|
+
]);
|
|
163
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Handles close button functionality
|
|
4
|
-
*/
|
|
5
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Pressable } from "react-native";
|
|
6
3
|
import { useAppDesignTokens, AtomicIcon, useAppNavigation, NavigationHeader } from "@umituz/react-native-design-system";
|
|
7
4
|
import { useLocalization } from "../../../domains/localization";
|
|
8
5
|
|
package/src/utils/appUtils.ts
CHANGED
|
@@ -16,6 +16,13 @@ export function getAppVersion(): string {
|
|
|
16
16
|
return version;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Gets the current build number from Expo constants
|
|
21
|
+
*/
|
|
22
|
+
export function getBuildNumber(): string | undefined {
|
|
23
|
+
return Constants.expoConfig?.ios?.buildNumber ?? Constants.expoConfig?.android?.versionCode?.toString();
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
/**
|
|
20
27
|
* Validates if the current platform is supported
|
|
21
28
|
*/
|