@umituz/react-native-settings 5.0.0 → 5.1.1

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": "5.0.0",
3
+ "version": "5.1.1",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -74,7 +74,7 @@
74
74
  "@types/react": "~19.1.10",
75
75
  "@typescript-eslint/eslint-plugin": "^7.18.0",
76
76
  "@typescript-eslint/parser": "^7.18.0",
77
- "@umituz/react-native-auth": "latest",
77
+ "@umituz/react-native-auth": "^4.1.1",
78
78
  "@umituz/react-native-design-system": "latest",
79
79
  "@umituz/react-native-firebase": "latest",
80
80
  "@umituz/react-native-sentry": "latest",
@@ -49,6 +49,7 @@ export interface SettingsScreenConfigResult {
49
49
  translatedFaqData: FAQData | undefined;
50
50
  isLoading: boolean;
51
51
  isAuthReady: boolean;
52
+ PasswordPromptComponent: React.ReactNode;
52
53
  }
53
54
 
54
55
  export const useSettingsScreenConfig = (
@@ -74,7 +75,7 @@ export const useSettingsScreenConfig = (
74
75
  const userProfileData = useUserProfile({});
75
76
 
76
77
  // Use centralized auth handlers
77
- const { handleRatePress, handleSignOut, handleDeleteAccount, handleSignIn } =
78
+ const { handleRatePress, handleSignOut, handleDeleteAccount, handleSignIn, PasswordPromptComponent } =
78
79
  useAuthHandlers(appInfo, translations?.errors);
79
80
 
80
81
  // Use settings config factory
@@ -163,7 +164,8 @@ export const useSettingsScreenConfig = (
163
164
  onLogout: handleSignOut,
164
165
  onDeleteAccount: handleDeleteAccount,
165
166
  translations: translations?.account as any,
166
- }), [user, userProfileData, handleSignIn, handleSignOut, handleDeleteAccount, translations]);
167
+ PasswordPromptComponent,
168
+ }), [user, userProfileData, handleSignIn, handleSignOut, handleDeleteAccount, translations, PasswordPromptComponent]);
167
169
 
168
170
  // Use centralized FAQ translation
169
171
  const translatedFaqData = useMemo(() =>
@@ -178,5 +180,6 @@ export const useSettingsScreenConfig = (
178
180
  translatedFaqData,
179
181
  isLoading: loading,
180
182
  isAuthReady,
183
+ PasswordPromptComponent,
181
184
  };
182
185
  };
@@ -51,6 +51,8 @@ export interface SettingsScreenProps {
51
51
  gamificationConfig?: import("../../domains/gamification").GamificationSettingsConfig;
52
52
  /** Show header (default: true) */
53
53
  showHeader?: boolean;
54
+ /** Password prompt modal component */
55
+ PasswordPromptComponent?: React.ReactNode;
54
56
  }
55
57
 
56
58
  export const SettingsScreen: React.FC<SettingsScreenProps> = (props) => {
@@ -69,6 +71,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = (props) => {
69
71
  featureOptions,
70
72
  devSettings,
71
73
  gamificationConfig,
74
+ PasswordPromptComponent,
72
75
  } = props;
73
76
 
74
77
  const {
@@ -94,21 +97,24 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = (props) => {
94
97
  ) : undefined;
95
98
 
96
99
  return (
97
- <ScreenLayout header={header}>
98
- {children ?? (
99
- <SettingsContent
100
- normalizedConfig={normalizedConfig}
101
- features={features}
102
- showUserProfile={shouldShowUserProfile}
103
- userProfile={userProfile}
104
- showFooter={showFooter}
105
- footerText={footerText}
106
- appVersion={appVersion}
107
- customSections={customSections}
108
- devSettings={devSettings}
109
- gamificationConfig={gamificationConfig}
110
- />
111
- )}
112
- </ScreenLayout>
100
+ <>
101
+ <ScreenLayout header={header}>
102
+ {children ?? (
103
+ <SettingsContent
104
+ normalizedConfig={normalizedConfig}
105
+ features={features}
106
+ showUserProfile={shouldShowUserProfile}
107
+ userProfile={userProfile}
108
+ showFooter={showFooter}
109
+ footerText={footerText}
110
+ appVersion={appVersion}
111
+ customSections={customSections}
112
+ devSettings={devSettings}
113
+ gamificationConfig={gamificationConfig}
114
+ />
115
+ )}
116
+ </ScreenLayout>
117
+ {PasswordPromptComponent}
118
+ </>
113
119
  );
114
120
  };
@@ -29,6 +29,7 @@ export interface CreateAccountConfigParams {
29
29
  onLogout: () => Promise<void>;
30
30
  onDeleteAccount: () => Promise<void>;
31
31
  translations?: AccountTranslations;
32
+ PasswordPromptComponent?: React.ReactNode;
32
33
  }
33
34
 
34
35
  /**
@@ -45,6 +46,7 @@ export function createAccountConfig(params: CreateAccountConfigParams): AccountS
45
46
  onLogout,
46
47
  onDeleteAccount,
47
48
  translations,
49
+ PasswordPromptComponent,
48
50
  } = params;
49
51
 
50
52
  const anonymous = isAnonymous ?? true;
@@ -74,6 +76,7 @@ export function createAccountConfig(params: CreateAccountConfigParams): AccountS
74
76
  isAnonymous: anonymous,
75
77
  editProfileText: translations?.editProfile || "",
76
78
  onSignIn,
79
+ PasswordPromptComponent,
77
80
  accountActions: hasValidAccountTranslations ? {
78
81
  onLogout,
79
82
  onDeleteAccount,
@@ -24,7 +24,7 @@ export const useAuthHandlers = (appInfo: AppInfo, translations?: SettingsTransla
24
24
  const { signOut } = useAuth();
25
25
  const { showAuthModal } = useAuthModalStore();
26
26
 
27
- const { deleteAccount: deleteAccountFromAuth } = useAccountManagement({
27
+ const { deleteAccount: deleteAccountFromAuth, PasswordPromptComponent } = useAccountManagement({
28
28
  passwordPromptTitle: translations?.deleteAccountTitle || "Confirm Account Deletion",
29
29
  passwordPromptMessage: translations?.deleteAccountMessage || "Please enter your password to permanently delete your account. This action cannot be undone.",
30
30
  passwordPromptCancel: translations?.cancel || "Cancel",
@@ -97,5 +97,6 @@ export const useAuthHandlers = (appInfo: AppInfo, translations?: SettingsTransla
97
97
  handleSignOut,
98
98
  handleDeleteAccount,
99
99
  handleSignIn,
100
+ PasswordPromptComponent,
100
101
  };
101
102
  };