@umituz/react-native-settings 5.2.0 → 5.2.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.2.
|
|
3
|
+
"version": "5.2.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,9 +74,9 @@
|
|
|
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": "^4.
|
|
77
|
+
"@umituz/react-native-auth": "^4.2.0",
|
|
78
78
|
"@umituz/react-native-design-system": "latest",
|
|
79
|
-
"@umituz/react-native-firebase": "
|
|
79
|
+
"@umituz/react-native-firebase": "^2.4.1",
|
|
80
80
|
"@umituz/react-native-sentry": "latest",
|
|
81
81
|
"eslint": "^8.57.0",
|
|
82
82
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useAuthModalStore,
|
|
12
12
|
useAccountManagement,
|
|
13
13
|
} from "@umituz/react-native-auth";
|
|
14
|
-
import { AlertService
|
|
14
|
+
import { AlertService } from "@umituz/react-native-design-system";
|
|
15
15
|
import type { AppInfo } from "../navigation/types";
|
|
16
16
|
import type { SettingsTranslations } from "../screens/types";
|
|
17
17
|
import { usePasswordPromptNavigation } from "./usePasswordPromptNavigation";
|
|
@@ -24,10 +24,8 @@ declare const __DEV__: boolean;
|
|
|
24
24
|
export const useAuthHandlers = (appInfo: AppInfo, translations?: SettingsTranslations["account"] & SettingsTranslations["errors"]) => {
|
|
25
25
|
const { signOut } = useAuth();
|
|
26
26
|
const { showAuthModal } = useAuthModalStore();
|
|
27
|
-
const navigation = useAppNavigation();
|
|
28
27
|
|
|
29
28
|
const { showPasswordPrompt } = usePasswordPromptNavigation({
|
|
30
|
-
navigation,
|
|
31
29
|
title: translations?.deleteAccountTitle || "Confirm Account Deletion",
|
|
32
30
|
message: translations?.deleteAccountMessage || "Please enter your password to permanently delete your account. This action cannot be undone.",
|
|
33
31
|
cancelText: translations?.cancel || "Cancel",
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useCallback, useRef } from 'react';
|
|
7
|
-
import
|
|
7
|
+
import { AppNavigation } from '@umituz/react-native-design-system';
|
|
8
8
|
|
|
9
9
|
export interface UsePasswordPromptNavigationOptions {
|
|
10
|
-
navigation: ReturnType<typeof useAppNavigation>;
|
|
11
10
|
title?: string;
|
|
12
11
|
message?: string;
|
|
13
12
|
confirmText?: string;
|
|
@@ -21,14 +20,14 @@ export interface UsePasswordPromptNavigationReturn {
|
|
|
21
20
|
export const usePasswordPromptNavigation = (
|
|
22
21
|
options: UsePasswordPromptNavigationOptions
|
|
23
22
|
): UsePasswordPromptNavigationReturn => {
|
|
24
|
-
const {
|
|
23
|
+
const { title, message, confirmText, cancelText } = options;
|
|
25
24
|
const resolveRef = useRef<((value: string | null) => void) | null>(null);
|
|
26
25
|
|
|
27
26
|
const showPasswordPrompt = useCallback((): Promise<string | null> => {
|
|
28
27
|
return new Promise<string | null>((resolve) => {
|
|
29
28
|
resolveRef.current = resolve;
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
const params = {
|
|
32
31
|
onComplete: (password: string | null) => {
|
|
33
32
|
if (resolveRef.current) {
|
|
34
33
|
resolveRef.current(password);
|
|
@@ -39,9 +38,14 @@ export const usePasswordPromptNavigation = (
|
|
|
39
38
|
message,
|
|
40
39
|
confirmText,
|
|
41
40
|
cancelText,
|
|
42
|
-
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
AppNavigation.navigate('Settings', {
|
|
44
|
+
screen: 'PasswordPrompt',
|
|
45
|
+
params,
|
|
46
|
+
} as any);
|
|
43
47
|
});
|
|
44
|
-
}, [
|
|
48
|
+
}, [title, message, confirmText, cancelText]);
|
|
45
49
|
|
|
46
50
|
return {
|
|
47
51
|
showPasswordPrompt,
|