@umituz/react-native-settings 4.21.6 → 4.21.8

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.21.6",
3
+ "version": "4.21.8",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, rating, and gamification",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -32,6 +32,7 @@ import {
32
32
  createLanguageSelectionScreenOptions,
33
33
  createGamificationScreenOptions,
34
34
  createAccountScreenOptions,
35
+ createSettingsMainScreenOptions,
35
36
  } from "./utils";
36
37
  import type { SettingsStackParamList, SettingsStackNavigatorProps } from "./types";
37
38
  import { GamificationScreenWrapper } from "../../domains/gamification";
@@ -57,7 +58,7 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
57
58
  const { handlePrivacyPress, handleTermsPress, handleEulaPress, aboutConfig } =
58
59
  useNavigationHandlers(appInfo, legalUrls);
59
60
 
60
- const screenOptions = React.useMemo(() => createScreenOptions(tokens), [tokens]);
61
+ const screenOptions = React.useMemo(() => createScreenOptions(tokens, t), [tokens, t]);
61
62
  const notificationTranslations = React.useMemo(() => createNotificationTranslations(t), [t]);
62
63
  const quietHoursTranslations = React.useMemo(() => createQuietHoursTranslations(t), [t]);
63
64
  const legalScreenProps = React.useMemo(
@@ -69,7 +70,7 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
69
70
  <Stack.Navigator screenOptions={screenOptions}>
70
71
  <Stack.Screen
71
72
  name="SettingsMain"
72
- options={{ headerShown: false }}
73
+ options={showHeader ? createSettingsMainScreenOptions(t) : { headerShown: false }}
73
74
  >
74
75
  {() => (
75
76
  <SettingsScreenWrapper
@@ -5,7 +5,9 @@
5
5
 
6
6
  import type { DesignTokens } from "@umituz/react-native-design-system";
7
7
 
8
- export const createScreenOptions = (tokens: DesignTokens) => ({
8
+ type TranslationFunction = (key: string) => string;
9
+
10
+ export const createScreenOptions = (tokens: DesignTokens, t: TranslationFunction) => ({
9
11
  headerStyle: {
10
12
  backgroundColor: tokens.colors.surface,
11
13
  borderBottomColor: tokens.colors.borderLight,
@@ -17,6 +19,11 @@ export const createScreenOptions = (tokens: DesignTokens) => ({
17
19
  color: tokens.colors.textPrimary,
18
20
  },
19
21
  headerTintColor: tokens.colors.textPrimary,
22
+ headerBackTitle: t("settings.title"),
23
+ headerBackTitleStyle: {
24
+ fontSize: 16,
25
+ color: tokens.colors.textPrimary,
26
+ },
20
27
  });
21
28
 
22
29
  export const createAppearanceScreenOptions = (t: any) => ({
@@ -67,3 +74,9 @@ export const createAccountScreenOptions = (t: any) => ({
67
74
  headerTitleAlign: "center" as const,
68
75
  });
69
76
 
77
+ export const createSettingsMainScreenOptions = (t: any) => ({
78
+ headerShown: true,
79
+ headerTitle: t("settings.title"),
80
+ headerTitleAlign: "center" as const,
81
+ });
82
+
@@ -51,6 +51,7 @@ export const createNotificationsConfig = (t: TranslationFunction): Notifications
51
51
  route: "Notifications",
52
52
  title: t("settings.notifications.title"),
53
53
  description: t("settings.notifications.description"),
54
+ sectionTitle: t("settings.notifications.sectionTitle"),
54
55
  icon: "notifications-outline",
55
56
  });
56
57