@umituz/react-native-settings 4.21.2 → 4.21.4

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.2",
3
+ "version": "4.21.4",
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",
@@ -9,6 +9,7 @@ import React from "react";
9
9
  import { createStackNavigator } from "@react-navigation/stack";
10
10
  import { useLocalization, LanguageSelectionScreen } from "@umituz/react-native-localization";
11
11
  import { NotificationSettingsScreen } from "@umituz/react-native-notifications";
12
+ import { AccountScreen } from "@umituz/react-native-auth";
12
13
  import { useAppDesignTokens } from "@umituz/react-native-design-system";
13
14
  import { AppearanceScreen } from "../screens/AppearanceScreen";
14
15
  import { FAQScreen } from "../../domains/faqs";
@@ -30,6 +31,7 @@ import {
30
31
  createFAQScreenOptions,
31
32
  createLanguageSelectionScreenOptions,
32
33
  createGamificationScreenOptions,
34
+ createAccountScreenOptions,
33
35
  } from "./utils";
34
36
  import type { SettingsStackParamList, SettingsStackNavigatorProps } from "./types";
35
37
  import { GamificationScreenWrapper } from "../../domains/gamification";
@@ -43,6 +45,7 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
43
45
  config = {},
44
46
  showUserProfile = false,
45
47
  userProfile,
48
+ accountConfig,
46
49
  additionalScreens = [],
47
50
  devSettings,
48
51
  customSections = [],
@@ -165,6 +168,15 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
165
168
  />
166
169
  )}
167
170
  </Stack.Screen>
171
+
172
+ {accountConfig && (
173
+ <Stack.Screen
174
+ name="Account"
175
+ options={createAccountScreenOptions(t)}
176
+ >
177
+ {() => <AccountScreen config={accountConfig} />}
178
+ </Stack.Screen>
179
+ )}
168
180
  </Stack.Navigator>
169
181
  );
170
182
  };
@@ -43,6 +43,7 @@ export type SettingsStackParamList = {
43
43
  FAQ: undefined;
44
44
  LanguageSelection: undefined;
45
45
  Gamification: undefined;
46
+ Account: undefined;
46
47
  };
47
48
 
48
49
  /**
@@ -76,6 +77,30 @@ export interface FAQData {
76
77
  categories: FAQCategory[];
77
78
  }
78
79
 
80
+ /**
81
+ * Account screen configuration from auth package
82
+ */
83
+ export interface AccountConfig {
84
+ profile: {
85
+ displayName?: string;
86
+ userId?: string;
87
+ isAnonymous: boolean;
88
+ avatarUrl?: string;
89
+ };
90
+ isAnonymous: boolean;
91
+ editProfileText?: string;
92
+ onSignIn?: () => void;
93
+ onEditProfile?: () => void;
94
+ accountActions?: {
95
+ onSignOut: () => void;
96
+ onDeleteAccount: () => void;
97
+ signOutText: string;
98
+ deleteAccountText: string;
99
+ confirmDeleteTitle: string;
100
+ confirmDeleteMessage: string;
101
+ };
102
+ }
103
+
79
104
  /**
80
105
  * Settings Stack Navigator Props
81
106
  */
@@ -86,6 +111,7 @@ export interface SettingsStackNavigatorProps {
86
111
  config?: SettingsConfig;
87
112
  showUserProfile?: boolean;
88
113
  userProfile?: UserProfileConfig;
114
+ accountConfig?: AccountConfig;
89
115
  additionalScreens?: AdditionalScreen[];
90
116
  devSettings?: DevSettingsProps;
91
117
  customSections?: CustomSettingsSection[];
@@ -61,3 +61,9 @@ export const createGamificationScreenOptions = (t: any) => ({
61
61
  headerTitleAlign: "center" as const,
62
62
  });
63
63
 
64
+ export const createAccountScreenOptions = (t: any) => ({
65
+ headerShown: true,
66
+ headerTitle: t("settings.account.title"),
67
+ headerTitleAlign: "center" as const,
68
+ });
69
+