@umituz/react-native-auth 3.4.33 → 3.4.35

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.
@@ -1,198 +1,196 @@
1
1
  # Auth Screens
2
2
 
3
- React Native Auth paketi için hazır ekran component'leri.
3
+ Pre-built screen components for authentication flows.
4
4
 
5
- ## Mevcut Screen'ler
5
+ ---
6
6
 
7
- - **[`LoginScreen`](./LoginScreen.tsx)** - Giriş ekranı
8
- - **[`RegisterScreen`](./RegisterScreen.tsx)** - Kayıt ekranı
9
- - **[`AccountScreen`](./AccountScreen.tsx)** - Hesap ayarları ekranı
10
- - **[`EditProfileScreen`](./EditProfileScreen.tsx)** - Profil düzenleme ekranı
7
+ ## Strategy
11
8
 
12
- ## Kullanım
9
+ **Purpose**: Provides complete authentication screens ready to use in navigation.
10
+
11
+ **When to Use**:
12
+ - Need complete auth screens
13
+ - Want consistent auth UI
14
+ - Rapid development
15
+ - Standard auth flows
16
+
17
+ **Location**: `src/presentation/screens/`
18
+
19
+ ---
20
+
21
+ ## Available Screens
13
22
 
14
23
  ### LoginScreen
15
24
 
25
+ **Purpose**: Complete login screen with form and social options
26
+
27
+ **When to Use**:
28
+ - App login entry point
29
+ - Need login screen
30
+ - Want pre-built solution
31
+
32
+ **Import Path**:
16
33
  ```typescript
17
34
  import { LoginScreen } from '@umituz/react-native-auth';
18
-
19
- function App() {
20
- return (
21
- <Stack.Navigator>
22
- <Stack.Screen
23
- name="Login"
24
- component={LoginScreen}
25
- options={{ headerShown: false }}
26
- />
27
- </Stack.Navigator>
28
- );
29
- }
30
35
  ```
31
36
 
37
+ **File**: `LoginScreen.tsx`
38
+
39
+ **Rules**:
40
+ - MUST configure navigation
41
+ - MUST handle auth callbacks
42
+ - MUST integrate with app navigation
43
+ - MUST NOT bypass AuthProvider
44
+
45
+ ---
46
+
32
47
  ### RegisterScreen
33
48
 
49
+ **Purpose**: Complete registration screen with validation
50
+
51
+ **When to Use**:
52
+ - User registration flow
53
+ - Account creation
54
+ - Need pre-built solution
55
+
56
+ **Import Path**:
34
57
  ```typescript
35
58
  import { RegisterScreen } from '@umituz/react-native-auth';
36
-
37
- function App() {
38
- return (
39
- <Stack.Navigator>
40
- <Stack.Screen
41
- name="Register"
42
- component={RegisterScreen}
43
- options={{ headerShown: false }}
44
- />
45
- </Stack.Navigator>
46
- );
47
- }
48
59
  ```
49
60
 
61
+ **File**: `RegisterScreen.tsx`
62
+
63
+ **Rules**:
64
+ - MUST configure navigation
65
+ - MUST provide legal links
66
+ - MUST handle registration success
67
+ - MUST NOT bypass AuthProvider
68
+
69
+ ---
70
+
50
71
  ### AccountScreen
51
72
 
73
+ **Purpose**: Account settings and profile management
74
+
75
+ **When to Use**:
76
+ - Account settings page
77
+ - Profile management
78
+ - Account operations
79
+
80
+ **Import Path**:
52
81
  ```typescript
53
82
  import { AccountScreen } from '@umituz/react-native-auth';
54
-
55
- function App() {
56
- return (
57
- <Stack.Navigator>
58
- <Stack.Screen
59
- name="Account"
60
- component={AccountScreen}
61
- options={{ title: 'Hesabım' }}
62
- />
63
- </Stack.Navigator>
64
- );
65
- }
66
83
  ```
67
84
 
85
+ **File**: `AccountScreen.tsx`
86
+
87
+ **Configuration**:
88
+ - Can customize with config prop
89
+ - Show/hide features
90
+ - Add custom actions
91
+
92
+ **Rules**:
93
+ - MUST only show to authenticated users
94
+ - MUST handle anonymous users separately
95
+ - MUST configure properly
96
+
97
+ ---
98
+
68
99
  ### EditProfileScreen
69
100
 
101
+ **Purpose**: Profile editing screen
102
+
103
+ **When to Use**:
104
+ - Profile editing
105
+ - User settings
106
+ - Profile photo update
107
+
108
+ **Import Path**:
70
109
  ```typescript
71
110
  import { EditProfileScreen } from '@umituz/react-native-auth';
72
-
73
- function App() {
74
- return (
75
- <Stack.Navigator>
76
- <Stack.Screen
77
- name="EditProfile"
78
- component={EditProfileScreen}
79
- options={{ title: 'Profili Düzenle' }}
80
- />
81
- </Stack.Navigator>
82
- );
83
- }
84
111
  ```
85
112
 
86
- ## AuthNavigator
113
+ **File**: `EditProfileScreen.tsx`
87
114
 
88
- Tüm auth ekranlarını içeren hazır navigator:
115
+ **Configuration**:
116
+ - Show/hide avatar editing
117
+ - Allow/disallow email change
118
+ - Custom validation rules
89
119
 
90
- ```typescript
91
- import { AuthNavigator } from '@umituz/react-native-auth';
92
-
93
- function App() {
94
- return (
95
- <NavigationContainer>
96
- <AuthNavigator />
97
- </NavigationContainer>
98
- );
99
- }
100
- ```
120
+ **Rules**:
121
+ - MUST validate before saving
122
+ - MUST handle photo uploads
123
+ - MUST show errors appropriately
101
124
 
102
- ## Konfigürasyon
125
+ ---
103
126
 
104
- ### AccountScreen Konfigürasyonu
127
+ ## Navigation Integration
105
128
 
106
- ```typescript
107
- import { AccountScreen } from '@umituz/react-native-auth';
129
+ ### Navigation Setup
108
130
 
109
- function SettingsScreen() {
110
- return (
111
- <AccountScreen
112
- config={{
113
- showChangePassword: true,
114
- benefits: ['Premium içeriklere erişim', 'Reklamsız deneyim'],
115
- }}
116
- />
117
- );
118
- }
119
- ```
131
+ **RULES**:
132
+ - MUST wrap with NavigationContainer
133
+ - MUST use proper stack navigator
134
+ - MUST set screen options
135
+ - MUST handle navigation callbacks
120
136
 
121
- ### EditProfileScreen Konfigürasyonu
137
+ **SCREEN OPTIONS**:
138
+ - `headerShown: false` - Hide default header
139
+ - `gestureEnabled: false` - Disable gestures (optional)
140
+ - Custom header components
122
141
 
123
- ```typescript
124
- import { EditProfileScreen } from '@umituz/react-native-auth';
142
+ ---
125
143
 
126
- function ProfileSettings() {
127
- return (
128
- <EditProfileScreen
129
- config={{
130
- showAvatar: true,
131
- allowEmailChange: false,
132
- maxDisplayNameLength: 50,
133
- }}
134
- />
135
- );
136
- }
137
- ```
144
+ ## Configuration
138
145
 
139
- ## Tam Örnek
146
+ ### Screen Configuration
140
147
 
141
- ```typescript
142
- import React from 'react';
143
- import { NavigationContainer } from '@react-navigation/native';
144
- import { createNativeStackNavigator } from '@react-navigation/native-stack';
145
- import {
146
- AuthNavigator,
147
- LoginScreen,
148
- RegisterScreen,
149
- AccountScreen,
150
- EditProfileScreen,
151
- } from '@umituz/react-native-auth';
152
-
153
- const Stack = createNativeStackNavigator();
154
-
155
- function App() {
156
- return (
157
- <NavigationContainer>
158
- <Stack.Navigator>
159
- {/* Auth ekranları */}
160
- <Stack.Screen
161
- name="Login"
162
- component={LoginScreen}
163
- options={{ headerShown: false }}
164
- />
165
- <Stack.Screen
166
- name="Register"
167
- component={RegisterScreen}
168
- options={{ headerShown: false }}
169
- />
170
-
171
- {/* Hesap ekranları */}
172
- <Stack.Screen
173
- name="Account"
174
- component={AccountScreen}
175
- options={{ title: 'Hesabım' }}
176
- />
177
- <Stack.Screen
178
- name="EditProfile"
179
- component={EditProfileScreen}
180
- options={{ title: 'Profili Düzenle' }}
181
- />
182
-
183
- {/* Diğer ekranlar */}
184
- <Stack.Screen name="Home" component={HomeScreen} />
185
- </Stack.Navigator>
186
- </NavigationContainer>
187
- );
188
- }
189
- ```
148
+ **ACCOUNT SCREEN**:
149
+ - `showChangePassword` - Show password change option
150
+ - `benefits` - List of account benefits
151
+ - Custom actions
152
+
153
+ **EDIT PROFILE SCREEN**:
154
+ - `showAvatar` - Enable avatar editing
155
+ - `allowEmailChange` - Allow email modification
156
+ - `maxDisplayNameLength` - Validation limit
157
+
158
+ **Rules**:
159
+ - MUST pass valid config
160
+ - MUST handle config changes
161
+ - MUST not pass invalid options
162
+
163
+ ---
164
+
165
+ ## Best Practices
166
+
167
+ ### Screen Composition
168
+
169
+ **RULES**:
170
+ - SHOULD use pre-built screens when possible
171
+ - MUST configure screens properly
172
+ - MUST handle navigation state
173
+ - MUST integrate with AuthProvider
174
+
175
+ **MUST NOT**:
176
+ - Bypass AuthProvider
177
+ - Break navigation flow
178
+ - Ignore configuration options
179
+
180
+ ---
181
+
182
+ ### Error Handling
190
183
 
191
- ## İlgili Component'ler
184
+ **RULES**:
185
+ - MUST handle auth errors in screens
186
+ - MUST show user-friendly messages
187
+ - MUST allow user retry
188
+ - MUST not crash on errors
192
189
 
193
- - **[Auth Components](../components/README.md)** - Auth UI component'leri
194
- - **[Auth Hooks](../hooks/README.md)** - Auth hook'ları
190
+ ---
195
191
 
196
- ## İlgili Navigation
192
+ ## Related Documentation
197
193
 
198
- - **[AuthNavigator](../navigation/AuthNavigator.tsx)** - Auth navigator
194
+ - **Components**: `../components/README.md`
195
+ - **Hooks**: `../hooks/README.md`
196
+ - **Services**: `../../infrastructure/services/README.md`