@umituz/react-native-auth 3.6.44 → 3.6.46
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 +2 -6
- package/src/index.ts +16 -6
- package/src/presentation/components/AccountActions.tsx +137 -146
- package/src/presentation/components/AuthBottomSheet.tsx +53 -47
- package/src/presentation/components/AuthHeader.tsx +3 -21
- package/src/presentation/components/AuthLegalLinks.tsx +31 -77
- package/src/presentation/components/LoginForm.tsx +23 -33
- package/src/presentation/components/PasswordMatchIndicator.tsx +8 -7
- package/src/presentation/components/PasswordStrengthIndicator.tsx +16 -20
- package/src/presentation/components/RegisterForm.tsx +45 -28
- package/src/presentation/components/SocialLoginButtons.tsx +43 -39
- package/src/presentation/hooks/useLoginForm.ts +28 -18
- package/src/presentation/hooks/useRegisterForm.ts +32 -46
- package/src/presentation/navigation/AuthNavigator.tsx +20 -20
- package/src/presentation/screens/ChangePasswordScreen.tsx +58 -57
- package/src/presentation/screens/LoginScreen.tsx +17 -12
- package/src/presentation/screens/RegisterScreen.tsx +16 -15
- package/src/types/translations.types.ts +89 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-auth",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.46",
|
|
4
4
|
"description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
"type": "git",
|
|
32
32
|
"url": "git+https://github.com/umituz/react-native-auth.git"
|
|
33
33
|
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@umituz/react-native-localization": "*"
|
|
36
|
-
},
|
|
34
|
+
"dependencies": {},
|
|
37
35
|
"peerDependencies": {
|
|
38
36
|
"@react-navigation/native": ">=6.0.0",
|
|
39
37
|
"@react-navigation/stack": ">=6.0.0",
|
|
@@ -87,9 +85,7 @@
|
|
|
87
85
|
"expo-video": "^3.0.15",
|
|
88
86
|
"expo-web-browser": "^12.0.0",
|
|
89
87
|
"firebase": "^11.0.0",
|
|
90
|
-
"i18next": "^25.7.3",
|
|
91
88
|
"react": "~19.1.0",
|
|
92
|
-
"react-i18next": "^16.5.1",
|
|
93
89
|
"react-native": "~0.81.5",
|
|
94
90
|
"react-native-gesture-handler": "^2.0.0",
|
|
95
91
|
"react-native-safe-area-context": "^4.0.0",
|
package/src/index.ts
CHANGED
|
@@ -129,6 +129,10 @@ export {
|
|
|
129
129
|
export { AuthProvider } from './presentation/providers/AuthProvider';
|
|
130
130
|
export { useAuth } from './presentation/hooks/useAuth';
|
|
131
131
|
export type { UseAuthResult } from './presentation/hooks/useAuth';
|
|
132
|
+
export { useLoginForm } from './presentation/hooks/useLoginForm';
|
|
133
|
+
export type { LoginFormTranslations as UseLoginFormTranslations, UseLoginFormConfig, UseLoginFormResult } from './presentation/hooks/useLoginForm';
|
|
134
|
+
export { useRegisterForm } from './presentation/hooks/useRegisterForm';
|
|
135
|
+
export type { RegisterFormTranslations as UseRegisterFormTranslations, UseRegisterFormConfig, UseRegisterFormResult } from './presentation/hooks/useRegisterForm';
|
|
132
136
|
export { useAuthRequired } from './presentation/hooks/useAuthRequired';
|
|
133
137
|
export type { UseAuthRequiredResult } from './presentation/hooks/useAuthRequired';
|
|
134
138
|
export { useRequireAuth, useUserId } from './presentation/hooks/useRequireAuth';
|
|
@@ -156,33 +160,39 @@ export type { MigrationConfig } from './domain/utils/migration';
|
|
|
156
160
|
|
|
157
161
|
// SCREENS & NAVIGATION
|
|
158
162
|
export { LoginScreen } from './presentation/screens/LoginScreen';
|
|
163
|
+
export type { LoginScreenTranslations, LoginScreenProps } from './presentation/screens/LoginScreen';
|
|
159
164
|
export { RegisterScreen } from './presentation/screens/RegisterScreen';
|
|
165
|
+
export type { RegisterScreenTranslations, RegisterScreenProps } from './presentation/screens/RegisterScreen';
|
|
160
166
|
export { AccountScreen } from './presentation/screens/AccountScreen';
|
|
161
167
|
export type { AccountScreenConfig, AccountScreenProps } from './presentation/screens/AccountScreen';
|
|
162
168
|
export { EditProfileScreen } from './presentation/screens/EditProfileScreen';
|
|
163
169
|
export type { EditProfileConfig, EditProfileScreenProps } from './presentation/screens/EditProfileScreen';
|
|
164
170
|
export { ChangePasswordScreen } from './presentation/screens/ChangePasswordScreen';
|
|
165
|
-
export type { ChangePasswordScreenProps } from './presentation/screens/ChangePasswordScreen';
|
|
171
|
+
export type { ChangePasswordTranslations, ChangePasswordScreenProps } from './presentation/screens/ChangePasswordScreen';
|
|
166
172
|
export { AuthNavigator } from './presentation/navigation/AuthNavigator';
|
|
167
173
|
export type {
|
|
168
174
|
AuthStackParamList,
|
|
175
|
+
AuthNavigatorTranslations,
|
|
169
176
|
AuthNavigatorProps,
|
|
170
177
|
} from './presentation/navigation/AuthNavigator';
|
|
171
178
|
|
|
172
179
|
// COMPONENTS
|
|
173
180
|
export { AuthHeader } from './presentation/components/AuthHeader';
|
|
181
|
+
export type { AuthHeaderProps } from './presentation/components/AuthHeader';
|
|
174
182
|
export { LoginForm } from './presentation/components/LoginForm';
|
|
183
|
+
export type { LoginFormTranslations, LoginFormProps } from './presentation/components/LoginForm';
|
|
175
184
|
export { RegisterForm } from './presentation/components/RegisterForm';
|
|
185
|
+
export type { RegisterFormTranslations, RegisterFormProps } from './presentation/components/RegisterForm';
|
|
176
186
|
export { AuthLegalLinks } from './presentation/components/AuthLegalLinks';
|
|
177
|
-
export type { AuthLegalLinksProps } from './presentation/components/AuthLegalLinks';
|
|
187
|
+
export type { AuthLegalLinksTranslations, AuthLegalLinksProps } from './presentation/components/AuthLegalLinks';
|
|
178
188
|
export { PasswordStrengthIndicator } from './presentation/components/PasswordStrengthIndicator';
|
|
179
|
-
export type { PasswordStrengthIndicatorProps } from './presentation/components/PasswordStrengthIndicator';
|
|
189
|
+
export type { PasswordStrengthTranslations, PasswordStrengthIndicatorProps } from './presentation/components/PasswordStrengthIndicator';
|
|
180
190
|
export { PasswordMatchIndicator } from './presentation/components/PasswordMatchIndicator';
|
|
181
|
-
export type { PasswordMatchIndicatorProps } from './presentation/components/PasswordMatchIndicator';
|
|
191
|
+
export type { PasswordMatchTranslations, PasswordMatchIndicatorProps } from './presentation/components/PasswordMatchIndicator';
|
|
182
192
|
export { AuthBottomSheet } from './presentation/components/AuthBottomSheet';
|
|
183
|
-
export type { AuthBottomSheetProps } from './presentation/components/AuthBottomSheet';
|
|
193
|
+
export type { AuthBottomSheetTranslations, AuthBottomSheetProps } from './presentation/components/AuthBottomSheet';
|
|
184
194
|
export { SocialLoginButtons } from './presentation/components/SocialLoginButtons';
|
|
185
|
-
export type { SocialLoginButtonsProps } from './presentation/components/SocialLoginButtons';
|
|
195
|
+
export type { SocialLoginButtonsTranslations, SocialLoginButtonsProps } from './presentation/components/SocialLoginButtons';
|
|
186
196
|
export { ProfileSection } from './presentation/components/ProfileSection';
|
|
187
197
|
export type { ProfileSectionConfig, ProfileSectionProps } from './presentation/components/ProfileSection';
|
|
188
198
|
export { AccountActions } from './presentation/components/AccountActions';
|
|
@@ -1,166 +1,157 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Account Actions Component
|
|
3
|
-
* Provides logout and delete account functionality
|
|
4
|
-
* Only shown for authenticated (non-anonymous) users
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React from "react";
|
|
8
2
|
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
9
3
|
import { useAppDesignTokens, AtomicIcon, AtomicText, useAlert, AlertType, AlertMode } from "@umituz/react-native-design-system";
|
|
10
|
-
import { useLocalization } from "@umituz/react-native-localization";
|
|
11
4
|
|
|
12
5
|
export interface AccountActionsConfig {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
logoutText: string;
|
|
7
|
+
deleteAccountText: string;
|
|
8
|
+
changePasswordText?: string;
|
|
9
|
+
logoutConfirmTitle: string;
|
|
10
|
+
logoutConfirmMessage: string;
|
|
11
|
+
deleteConfirmTitle: string;
|
|
12
|
+
deleteConfirmMessage: string;
|
|
13
|
+
deleteErrorTitle?: string;
|
|
14
|
+
deleteErrorMessage?: string;
|
|
15
|
+
cancelText: string;
|
|
16
|
+
onLogout: () => Promise<void>;
|
|
17
|
+
onDeleteAccount: () => Promise<void>;
|
|
18
|
+
onChangePassword?: () => void;
|
|
19
|
+
showChangePassword?: boolean;
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
export interface AccountActionsProps {
|
|
29
|
-
|
|
23
|
+
config: AccountActionsConfig;
|
|
30
24
|
}
|
|
31
25
|
|
|
32
26
|
export const AccountActions: React.FC<AccountActionsProps> = ({ config }) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
27
|
+
const tokens = useAppDesignTokens();
|
|
28
|
+
const alert = useAlert();
|
|
29
|
+
const {
|
|
30
|
+
logoutText,
|
|
31
|
+
deleteAccountText,
|
|
32
|
+
changePasswordText,
|
|
33
|
+
logoutConfirmTitle,
|
|
34
|
+
logoutConfirmMessage,
|
|
35
|
+
deleteConfirmTitle,
|
|
36
|
+
deleteConfirmMessage,
|
|
37
|
+
deleteErrorTitle = "Error",
|
|
38
|
+
deleteErrorMessage = "Failed to delete account. Please try again.",
|
|
39
|
+
cancelText,
|
|
40
|
+
onLogout,
|
|
41
|
+
onDeleteAccount,
|
|
42
|
+
onChangePassword,
|
|
43
|
+
showChangePassword = false,
|
|
44
|
+
} = config;
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
46
|
+
const handleLogout = () => {
|
|
47
|
+
alert.show(AlertType.WARNING, AlertMode.MODAL, logoutConfirmTitle, logoutConfirmMessage, {
|
|
48
|
+
actions: [
|
|
49
|
+
{
|
|
50
|
+
id: "cancel",
|
|
51
|
+
label: cancelText,
|
|
52
|
+
style: "secondary",
|
|
53
|
+
onPress: () => {},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "confirm",
|
|
57
|
+
label: logoutText,
|
|
58
|
+
style: "destructive",
|
|
59
|
+
onPress: async () => {
|
|
60
|
+
try {
|
|
61
|
+
await onLogout();
|
|
62
|
+
} catch {
|
|
63
|
+
// Silent error handling
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
};
|
|
76
70
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
71
|
+
const handleDeleteAccount = () => {
|
|
72
|
+
alert.show(AlertType.ERROR, AlertMode.MODAL, deleteConfirmTitle, deleteConfirmMessage, {
|
|
73
|
+
actions: [
|
|
74
|
+
{
|
|
75
|
+
id: "cancel",
|
|
76
|
+
label: cancelText,
|
|
77
|
+
style: "secondary",
|
|
78
|
+
onPress: () => {},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "confirm",
|
|
82
|
+
label: deleteAccountText,
|
|
83
|
+
style: "destructive",
|
|
84
|
+
onPress: async () => {
|
|
85
|
+
try {
|
|
86
|
+
await onDeleteAccount();
|
|
87
|
+
} catch {
|
|
88
|
+
alert.showError(deleteErrorTitle, deleteErrorMessage, { mode: AlertMode.MODAL });
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
});
|
|
94
|
+
};
|
|
101
95
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
)}
|
|
96
|
+
return (
|
|
97
|
+
<View style={styles.container}>
|
|
98
|
+
{showChangePassword && onChangePassword && changePasswordText && (
|
|
99
|
+
<TouchableOpacity
|
|
100
|
+
style={[styles.actionButton, { borderColor: tokens.colors.border }]}
|
|
101
|
+
onPress={onChangePassword}
|
|
102
|
+
activeOpacity={0.7}
|
|
103
|
+
>
|
|
104
|
+
<AtomicIcon name="key-outline" size="md" color="textPrimary" />
|
|
105
|
+
<AtomicText style={styles.actionText} color="textPrimary">
|
|
106
|
+
{changePasswordText}
|
|
107
|
+
</AtomicText>
|
|
108
|
+
<AtomicIcon name="chevron-forward" size="sm" color="textSecondary" />
|
|
109
|
+
</TouchableOpacity>
|
|
110
|
+
)}
|
|
118
111
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
</TouchableOpacity>
|
|
112
|
+
<TouchableOpacity
|
|
113
|
+
style={[styles.actionButton, { borderColor: tokens.colors.border }]}
|
|
114
|
+
onPress={handleLogout}
|
|
115
|
+
activeOpacity={0.7}
|
|
116
|
+
>
|
|
117
|
+
<AtomicIcon name="log-out-outline" size="md" color="error" />
|
|
118
|
+
<AtomicText style={styles.actionText} color="error">
|
|
119
|
+
{logoutText}
|
|
120
|
+
</AtomicText>
|
|
121
|
+
<AtomicIcon name="chevron-forward" size="sm" color="textSecondary" />
|
|
122
|
+
</TouchableOpacity>
|
|
131
123
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
);
|
|
124
|
+
<TouchableOpacity
|
|
125
|
+
style={[styles.actionButton, { borderColor: tokens.colors.border }]}
|
|
126
|
+
onPress={handleDeleteAccount}
|
|
127
|
+
activeOpacity={0.7}
|
|
128
|
+
>
|
|
129
|
+
<AtomicIcon name="trash-outline" size="md" color="error" />
|
|
130
|
+
<AtomicText style={styles.actionText} color="error">
|
|
131
|
+
{deleteAccountText}
|
|
132
|
+
</AtomicText>
|
|
133
|
+
<AtomicIcon name="chevron-forward" size="sm" color="textSecondary" />
|
|
134
|
+
</TouchableOpacity>
|
|
135
|
+
</View>
|
|
136
|
+
);
|
|
146
137
|
};
|
|
147
138
|
|
|
148
139
|
const styles = StyleSheet.create({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
140
|
+
container: {
|
|
141
|
+
gap: 12,
|
|
142
|
+
},
|
|
143
|
+
actionButton: {
|
|
144
|
+
flexDirection: "row",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
paddingVertical: 16,
|
|
147
|
+
paddingHorizontal: 16,
|
|
148
|
+
borderRadius: 12,
|
|
149
|
+
borderWidth: 1,
|
|
150
|
+
gap: 12,
|
|
151
|
+
},
|
|
152
|
+
actionText: {
|
|
153
|
+
flex: 1,
|
|
154
|
+
fontSize: 16,
|
|
155
|
+
fontWeight: "500",
|
|
156
|
+
},
|
|
166
157
|
});
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AuthBottomSheet Component
|
|
3
|
-
* Bottom sheet modal for authentication (Login/Register)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import React, { useEffect } from "react";
|
|
7
2
|
import { View, TouchableOpacity, ScrollView } from "react-native";
|
|
8
3
|
import {
|
|
@@ -12,31 +7,39 @@ import {
|
|
|
12
7
|
AtomicKeyboardAvoidingView,
|
|
13
8
|
BottomSheetModal,
|
|
14
9
|
} from "@umituz/react-native-design-system";
|
|
15
|
-
import { useLocalization } from "@umituz/react-native-localization";
|
|
16
10
|
import { useAuthBottomSheet, type SocialAuthConfiguration } from "../hooks/useAuthBottomSheet";
|
|
17
|
-
import { LoginForm } from "./LoginForm";
|
|
18
|
-
import { RegisterForm } from "./RegisterForm";
|
|
19
|
-
import { SocialLoginButtons } from "./SocialLoginButtons";
|
|
11
|
+
import { LoginForm, type LoginFormTranslations } from "./LoginForm";
|
|
12
|
+
import { RegisterForm, type RegisterFormTranslations } from "./RegisterForm";
|
|
13
|
+
import { SocialLoginButtons, type SocialLoginButtonsTranslations } from "./SocialLoginButtons";
|
|
20
14
|
import { styles } from "./AuthBottomSheet.styles";
|
|
21
15
|
|
|
22
16
|
declare const __DEV__: boolean;
|
|
23
17
|
|
|
18
|
+
export interface AuthBottomSheetTranslations {
|
|
19
|
+
close: string;
|
|
20
|
+
signIn: string;
|
|
21
|
+
signInSubtitle: string;
|
|
22
|
+
createAccount: string;
|
|
23
|
+
createAccountSubtitle: string;
|
|
24
|
+
loginForm: LoginFormTranslations;
|
|
25
|
+
registerForm: RegisterFormTranslations;
|
|
26
|
+
socialButtons: SocialLoginButtonsTranslations;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
export interface AuthBottomSheetProps {
|
|
30
|
+
translations: AuthBottomSheetTranslations;
|
|
25
31
|
termsUrl?: string;
|
|
26
32
|
privacyUrl?: string;
|
|
27
33
|
onTermsPress?: () => void;
|
|
28
34
|
onPrivacyPress?: () => void;
|
|
29
|
-
/** Social auth configuration */
|
|
30
35
|
socialConfig?: SocialAuthConfiguration;
|
|
31
|
-
/** Called when Google sign-in is requested (overrides internal behavior) */
|
|
32
36
|
onGoogleSignIn?: () => Promise<void>;
|
|
33
|
-
/** Called when Apple sign-in is requested (overrides internal behavior) */
|
|
34
37
|
onAppleSignIn?: () => Promise<void>;
|
|
35
|
-
/** Called when auth completes successfully (login or register) */
|
|
36
38
|
onAuthSuccess?: () => void;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
|
|
42
|
+
translations,
|
|
40
43
|
termsUrl,
|
|
41
44
|
privacyUrl,
|
|
42
45
|
onTermsPress,
|
|
@@ -47,7 +50,6 @@ export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
|
|
|
47
50
|
onAuthSuccess,
|
|
48
51
|
}) => {
|
|
49
52
|
const tokens = useAppDesignTokens();
|
|
50
|
-
const { t } = useLocalization();
|
|
51
53
|
|
|
52
54
|
const {
|
|
53
55
|
modalRef,
|
|
@@ -93,7 +95,7 @@ export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
|
|
|
93
95
|
style={styles.closeButton}
|
|
94
96
|
onPress={handleClose}
|
|
95
97
|
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
96
|
-
accessibilityLabel={
|
|
98
|
+
accessibilityLabel={translations.close}
|
|
97
99
|
accessibilityRole="button"
|
|
98
100
|
>
|
|
99
101
|
<AtomicIcon name="close" size="md" color="textSecondary" />
|
|
@@ -104,40 +106,44 @@ export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
|
|
|
104
106
|
showsVerticalScrollIndicator={false}
|
|
105
107
|
keyboardShouldPersistTaps="handled"
|
|
106
108
|
>
|
|
109
|
+
<View style={styles.header}>
|
|
110
|
+
<AtomicText type="headlineLarge" color="textPrimary" style={styles.title}>
|
|
111
|
+
{mode === "login" ? translations.signIn : translations.createAccount}
|
|
112
|
+
</AtomicText>
|
|
113
|
+
<AtomicText type="bodyLarge" color="textSecondary" style={styles.subtitle}>
|
|
114
|
+
{mode === "login" ? translations.signInSubtitle : translations.createAccountSubtitle}
|
|
115
|
+
</AtomicText>
|
|
116
|
+
</View>
|
|
107
117
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
privacyUrl={privacyUrl}
|
|
125
|
-
onTermsPress={onTermsPress}
|
|
126
|
-
onPrivacyPress={onPrivacyPress}
|
|
127
|
-
/>
|
|
128
|
-
)}
|
|
118
|
+
<View style={styles.formContainer}>
|
|
119
|
+
{mode === "login" ? (
|
|
120
|
+
<LoginForm
|
|
121
|
+
translations={translations.loginForm}
|
|
122
|
+
onNavigateToRegister={handleNavigateToRegister}
|
|
123
|
+
/>
|
|
124
|
+
) : (
|
|
125
|
+
<RegisterForm
|
|
126
|
+
translations={translations.registerForm}
|
|
127
|
+
onNavigateToLogin={handleNavigateToLogin}
|
|
128
|
+
termsUrl={termsUrl}
|
|
129
|
+
privacyUrl={privacyUrl}
|
|
130
|
+
onTermsPress={onTermsPress}
|
|
131
|
+
onPrivacyPress={onPrivacyPress}
|
|
132
|
+
/>
|
|
133
|
+
)}
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
{providers.length > 0 && (
|
|
136
|
+
<SocialLoginButtons
|
|
137
|
+
translations={translations.socialButtons}
|
|
138
|
+
enabledProviders={providers}
|
|
139
|
+
onGooglePress={() => { void handleGoogleSignIn(); }}
|
|
140
|
+
onApplePress={() => { void handleAppleSignIn(); }}
|
|
141
|
+
googleLoading={googleLoading}
|
|
142
|
+
appleLoading={appleLoading}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
145
|
+
</View>
|
|
146
|
+
</ScrollView>
|
|
141
147
|
</AtomicKeyboardAvoidingView>
|
|
142
148
|
</BottomSheetModal>
|
|
143
149
|
);
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth Header Component
|
|
3
|
-
* Reusable header for auth screens
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import React from "react";
|
|
7
2
|
import { View, StyleSheet } from "react-native";
|
|
8
3
|
import { AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
|
-
import { useLocalization } from "@umituz/react-native-localization";
|
|
10
4
|
|
|
11
|
-
interface AuthHeaderProps {
|
|
5
|
+
export interface AuthHeaderProps {
|
|
12
6
|
title: string;
|
|
13
7
|
subtitle?: string;
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
export const AuthHeader: React.FC<AuthHeaderProps> = ({ title, subtitle }) => {
|
|
17
11
|
const tokens = useAppDesignTokens();
|
|
18
|
-
const { t } = useLocalization();
|
|
19
12
|
|
|
20
13
|
return (
|
|
21
14
|
<View style={[styles.header, { marginBottom: tokens.spacing.xl, paddingHorizontal: tokens.spacing.md }]}>
|
|
@@ -26,7 +19,7 @@ export const AuthHeader: React.FC<AuthHeaderProps> = ({ title, subtitle }) => {
|
|
|
26
19
|
>
|
|
27
20
|
{title}
|
|
28
21
|
</AtomicText>
|
|
29
|
-
{
|
|
22
|
+
{subtitle && (
|
|
30
23
|
<AtomicText
|
|
31
24
|
type="bodyMedium"
|
|
32
25
|
color="textSecondary"
|
|
@@ -35,7 +28,7 @@ export const AuthHeader: React.FC<AuthHeaderProps> = ({ title, subtitle }) => {
|
|
|
35
28
|
marginTop: tokens.spacing.xs,
|
|
36
29
|
}}
|
|
37
30
|
>
|
|
38
|
-
{subtitle
|
|
31
|
+
{subtitle}
|
|
39
32
|
</AtomicText>
|
|
40
33
|
)}
|
|
41
34
|
</View>
|
|
@@ -47,14 +40,3 @@ const styles = StyleSheet.create({
|
|
|
47
40
|
alignItems: "center",
|
|
48
41
|
},
|
|
49
42
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|