@umituz/react-native-settings 4.20.58 → 4.20.59
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/.github/ISSUE_TEMPLATE/bug_report.md +51 -0
- package/.github/ISSUE_TEMPLATE/documentation.md +52 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +63 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +84 -0
- package/AI_AGENT_GUIDELINES.md +367 -0
- package/ARCHITECTURE.md +246 -0
- package/CHANGELOG.md +67 -0
- package/CODE_OF_CONDUCT.md +75 -0
- package/CONTRIBUTING.md +107 -0
- package/DOCUMENTATION_MIGRATION.md +319 -0
- package/DOCUMENTATION_TEMPLATE.md +155 -0
- package/LICENSE +21 -0
- package/README.md +321 -498
- package/SECURITY.md +98 -0
- package/SETTINGS_SCREEN_GUIDE.md +185 -0
- package/TESTING.md +358 -0
- package/package.json +13 -2
- package/src/application/README.md +85 -271
- package/src/domains/about/README.md +85 -440
- package/src/domains/about/presentation/hooks/README.md +93 -348
- package/src/domains/appearance/README.md +95 -584
- package/src/domains/appearance/hooks/README.md +95 -303
- package/src/domains/appearance/infrastructure/services/README.md +83 -397
- package/src/domains/appearance/presentation/components/README.md +95 -489
- package/src/domains/cloud-sync/README.md +73 -439
- package/src/domains/cloud-sync/presentation/components/README.md +95 -493
- package/src/domains/dev/README.md +71 -457
- package/src/domains/disclaimer/README.md +77 -411
- package/src/domains/disclaimer/presentation/components/README.md +95 -392
- package/src/domains/faqs/README.md +86 -574
- package/src/domains/feedback/README.md +79 -553
- package/src/domains/feedback/presentation/hooks/README.md +93 -426
- package/src/domains/legal/README.md +88 -537
- package/src/domains/rating/README.md +73 -440
- package/src/domains/rating/presentation/components/README.md +95 -475
- package/src/domains/video-tutorials/README.md +77 -470
- package/src/domains/video-tutorials/presentation/components/README.md +95 -431
- package/src/infrastructure/README.md +78 -425
- package/src/infrastructure/repositories/README.md +88 -420
- package/src/infrastructure/services/README.md +74 -460
- package/src/presentation/components/README.md +97 -480
- package/src/presentation/components/SettingsErrorBoundary/README.md +48 -436
- package/src/presentation/components/SettingsFooter/README.md +48 -427
- package/src/presentation/components/SettingsItemCard/README.md +152 -391
- package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
- package/src/presentation/components/SettingsSection/README.md +47 -401
- package/src/presentation/hooks/README.md +95 -389
- package/src/presentation/hooks/mutations/README.md +99 -376
- package/src/presentation/hooks/queries/README.md +111 -353
- package/src/presentation/navigation/README.md +70 -502
- package/src/presentation/navigation/components/README.md +70 -295
- package/src/presentation/navigation/hooks/README.md +75 -367
- package/src/presentation/navigation/utils/README.md +100 -380
- package/src/presentation/screens/README.md +53 -504
- package/src/presentation/screens/components/SettingsContent/README.md +53 -382
- package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
- package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
- package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
- package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
- package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
- package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
- package/src/presentation/screens/hooks/README.md +64 -354
- package/src/presentation/screens/types/README.md +79 -409
- package/src/presentation/screens/utils/README.md +65 -255
|
@@ -1,330 +1,105 @@
|
|
|
1
1
|
# Navigation Components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Components
|
|
6
|
-
|
|
7
|
-
### SettingsScreenWrapper
|
|
8
|
-
|
|
9
|
-
Wrapper component for the main Settings screen that injects configuration, navigation, and user profile props.
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
import { SettingsScreenWrapper } from '@umituz/react-native-settings';
|
|
3
|
+
## Purpose
|
|
13
4
|
|
|
14
|
-
|
|
15
|
-
name="Settings"
|
|
16
|
-
component={SettingsScreenWrapper}
|
|
17
|
-
options={{ headerShown: false }}
|
|
18
|
-
/>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
#### Props
|
|
22
|
-
|
|
23
|
-
Automatically receives and injects:
|
|
24
|
-
- `config`: Settings configuration from navigation params
|
|
25
|
-
- `appInfo`: Application information object
|
|
26
|
-
- `userProfile`: User profile data
|
|
27
|
-
- `customSections`: Custom settings sections
|
|
28
|
-
- `devSettings`: Development settings configuration
|
|
29
|
-
|
|
30
|
-
### LegalScreenWrapper
|
|
31
|
-
|
|
32
|
-
Wrapper component for legal screens (Privacy Policy, Terms of Service, etc.) with content and styling configuration.
|
|
33
|
-
|
|
34
|
-
```tsx
|
|
35
|
-
import { LegalScreenWrapper } from '@umituz/react-native-settings';
|
|
36
|
-
|
|
37
|
-
<Stack.Screen
|
|
38
|
-
name="PrivacyPolicy"
|
|
39
|
-
component={LegalScreenWrapper}
|
|
40
|
-
/>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
#### Features
|
|
44
|
-
|
|
45
|
-
- Dynamic document type from route params
|
|
46
|
-
- Content injection from navigation
|
|
47
|
-
- Custom styling support
|
|
48
|
-
- Title and header configuration
|
|
5
|
+
Screen wrapper components for integrating settings screens into React Navigation with proper props passing and configuration.
|
|
49
6
|
|
|
50
|
-
|
|
7
|
+
## File Paths
|
|
51
8
|
|
|
52
|
-
|
|
9
|
+
- **Settings Wrapper**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/navigation/components/SettingsScreenWrapper.tsx`
|
|
10
|
+
- **Legal Wrapper**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/navigation/components/LegalScreenWrapper.tsx`
|
|
11
|
+
- **About Wrapper**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/navigation/components/AboutScreenWrapper.tsx`
|
|
53
12
|
|
|
54
|
-
|
|
55
|
-
import { AboutScreenWrapper } from '@umituz/react-native-settings';
|
|
13
|
+
## Strategy
|
|
56
14
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
15
|
+
1. **Props Injection**: Automatically injects configuration and navigation props into screens
|
|
16
|
+
2. **Configuration Management**: Handles all screen configuration centrally
|
|
17
|
+
3. **Type Safety**: Provides TypeScript types for all wrapper props
|
|
18
|
+
4. **Consistency**: Ensures consistent props passing across all screens
|
|
19
|
+
5. **Flexibility**: Supports custom configuration via route params
|
|
62
20
|
|
|
63
|
-
|
|
21
|
+
## Restrictions (Forbidden)
|
|
64
22
|
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
23
|
+
### DO NOT
|
|
24
|
+
- ❌ DO NOT use screen components directly without wrappers
|
|
25
|
+
- ❌ DO NOT manually pass props to screen components
|
|
26
|
+
- ❌ DO NOT create custom screen wrappers without understanding the pattern
|
|
69
27
|
|
|
70
|
-
|
|
28
|
+
### NEVER
|
|
29
|
+
- ❌ NEVER bypass wrappers for "simple" screens
|
|
30
|
+
- ❌ NEVER hardcode configuration in screen components
|
|
31
|
+
- ❌ NEVER use wrappers outside of NavigationContext
|
|
71
32
|
|
|
72
|
-
###
|
|
33
|
+
### AVOID
|
|
34
|
+
- ❌ AVOID creating wrapper chains (keep it flat)
|
|
35
|
+
- ❌ AVOID mixing wrapper patterns
|
|
36
|
+
- ❌ AVOID complex prop drilling (wrappers handle this)
|
|
73
37
|
|
|
74
|
-
|
|
75
|
-
import { SettingsStackNavigator } from '@umituz/react-native-settings';
|
|
38
|
+
## Rules (Mandatory)
|
|
76
39
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
developer: 'My Company',
|
|
83
|
-
websiteUrl: 'https://example.com',
|
|
84
|
-
};
|
|
40
|
+
### ALWAYS
|
|
41
|
+
- ✅ ALWAYS use screen wrappers for all settings screens
|
|
42
|
+
- ✅ ALWAYS pass configuration via initialParams or navigator props
|
|
43
|
+
- ✅ MUST use TypeScript types for wrapper props
|
|
44
|
+
- ✅ MUST keep wrappers focused on props injection only
|
|
85
45
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
```
|
|
46
|
+
### MUST
|
|
47
|
+
- ✅ MUST extract configuration from route.params or navigator props
|
|
48
|
+
- ✅ MUST pass all required props to wrapped screen
|
|
49
|
+
- ✅ MUST handle missing configuration gracefully
|
|
93
50
|
|
|
94
|
-
###
|
|
51
|
+
### SHOULD
|
|
52
|
+
- ✅ SHOULD keep wrapper logic minimal (props injection only)
|
|
53
|
+
- ✅ SHOULD use consistent naming pattern for wrappers
|
|
54
|
+
- ✅ SHOULD test wrappers with various configurations
|
|
95
55
|
|
|
96
|
-
|
|
97
|
-
import { SettingsScreenWrapper, LegalScreenWrapper, AboutScreenWrapper } from '@umituz/react-native-settings';
|
|
56
|
+
## AI Agent Guidelines
|
|
98
57
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
headerShown: false,
|
|
105
|
-
presentation: 'card',
|
|
106
|
-
}}
|
|
107
|
-
/>
|
|
108
|
-
<Stack.Screen
|
|
109
|
-
name="Appearance"
|
|
110
|
-
component={AppearanceScreen}
|
|
111
|
-
options={{ title: 'Appearance' }}
|
|
112
|
-
/>
|
|
113
|
-
<Stack.Screen
|
|
114
|
-
name="PrivacyPolicy"
|
|
115
|
-
component={LegalScreenWrapper}
|
|
116
|
-
options={{ title: 'Privacy Policy' }}
|
|
117
|
-
/>
|
|
118
|
-
<Stack.Screen
|
|
119
|
-
name="TermsOfService"
|
|
120
|
-
component={LegalScreenWrapper}
|
|
121
|
-
options={{ title: 'Terms of Service' }}
|
|
122
|
-
/>
|
|
123
|
-
<Stack.Screen
|
|
124
|
-
name="About"
|
|
125
|
-
component={AboutScreenWrapper}
|
|
126
|
-
options={{ title: 'About' }}
|
|
127
|
-
/>
|
|
128
|
-
</Stack.Navigator>
|
|
129
|
-
```
|
|
58
|
+
1. **File Reference**: When modifying wrappers, refer to `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/navigation/components/`
|
|
59
|
+
2. **Wrapper Purpose**: Wrappers exist solely to inject props, not to add functionality
|
|
60
|
+
3. **Config Flow**: Configuration flows from navigator props → route.params → screen props
|
|
61
|
+
4. **Type Safety**: Always use proper TypeScript types for route params
|
|
62
|
+
5. **Minimal Logic**: Keep wrappers simple, avoid complex business logic
|
|
130
63
|
|
|
131
|
-
##
|
|
64
|
+
## Component Reference
|
|
132
65
|
|
|
133
66
|
### SettingsScreenWrapper
|
|
134
67
|
|
|
135
|
-
|
|
136
|
-
interface SettingsScreenWrapperProps {
|
|
137
|
-
route: {
|
|
138
|
-
params: {
|
|
139
|
-
config?: SettingsConfig;
|
|
140
|
-
appInfo?: AppInfo;
|
|
141
|
-
userProfile?: UserProfile;
|
|
142
|
-
customSections?: CustomSettingsSection[];
|
|
143
|
-
devSettings?: DevSettingsProps;
|
|
144
|
-
showCloseButton?: boolean;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
navigation: any;
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### LegalScreenWrapper
|
|
68
|
+
**Purpose**: Wraps main settings screen with configuration and props
|
|
152
69
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
title?: string;
|
|
160
|
-
styles?: LegalContentStyles;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### AboutScreenWrapper
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
interface AboutScreenWrapperProps {
|
|
170
|
-
route: {
|
|
171
|
-
params: {
|
|
172
|
-
appInfo?: AppInfo;
|
|
173
|
-
config?: AboutConfig;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## Usage Examples
|
|
180
|
-
|
|
181
|
-
### With Custom Config
|
|
182
|
-
|
|
183
|
-
```tsx
|
|
184
|
-
function SettingsStack() {
|
|
185
|
-
const config = {
|
|
186
|
-
appearance: true,
|
|
187
|
-
language: true,
|
|
188
|
-
notifications: 'auto',
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const userProfile = {
|
|
192
|
-
displayName: 'John Doe',
|
|
193
|
-
email: 'john@example.com',
|
|
194
|
-
avatarUrl: 'https://example.com/avatar.jpg',
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
return (
|
|
198
|
-
<Stack.Screen
|
|
199
|
-
name="Settings"
|
|
200
|
-
component={SettingsScreenWrapper}
|
|
201
|
-
initialParams={{ config, userProfile }}
|
|
202
|
-
/>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### With Custom Styling
|
|
208
|
-
|
|
209
|
-
```tsx
|
|
210
|
-
function PrivacyStack() {
|
|
211
|
-
const customStyles = {
|
|
212
|
-
container: { backgroundColor: '#f5f5f5' },
|
|
213
|
-
content: { fontSize: 16, lineHeight: 24 },
|
|
214
|
-
header: { color: '#333' },
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
return (
|
|
218
|
-
<Stack.Screen
|
|
219
|
-
name="PrivacyPolicy"
|
|
220
|
-
component={LegalScreenWrapper}
|
|
221
|
-
initialParams={{
|
|
222
|
-
documentType: 'privacy-policy',
|
|
223
|
-
styles: customStyles,
|
|
224
|
-
}}
|
|
225
|
-
/>
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### With App Information
|
|
231
|
-
|
|
232
|
-
```tsx
|
|
233
|
-
function AboutStack() {
|
|
234
|
-
const appInfo = {
|
|
235
|
-
name: 'My Application',
|
|
236
|
-
version: '2.0.0',
|
|
237
|
-
buildNumber: '200',
|
|
238
|
-
developer: 'My Company LLC',
|
|
239
|
-
contactEmail: 'support@example.com',
|
|
240
|
-
websiteUrl: 'https://example.com',
|
|
241
|
-
websiteDisplay: 'example.com',
|
|
242
|
-
moreAppsUrl: 'https://example.com/apps',
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
return (
|
|
246
|
-
<Stack.Screen
|
|
247
|
-
name="About"
|
|
248
|
-
component={AboutScreenWrapper}
|
|
249
|
-
initialParams={{ appInfo }}
|
|
250
|
-
/>
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
```
|
|
70
|
+
**Injected Props**:
|
|
71
|
+
- `config`: Settings configuration
|
|
72
|
+
- `appInfo`: Application information
|
|
73
|
+
- `userProfile`: User profile data
|
|
74
|
+
- `customSections`: Custom settings sections
|
|
75
|
+
- `devSettings`: Development settings configuration
|
|
254
76
|
|
|
255
|
-
|
|
77
|
+
**Usage**: Use in Stack.Screen component
|
|
256
78
|
|
|
257
|
-
###
|
|
79
|
+
### LegalScreenWrapper
|
|
258
80
|
|
|
259
|
-
|
|
260
|
-
<Stack.Screen
|
|
261
|
-
name="Settings"
|
|
262
|
-
component={SettingsScreenWrapper}
|
|
263
|
-
options={{
|
|
264
|
-
presentation: 'modal',
|
|
265
|
-
headerShown: false,
|
|
266
|
-
cardStyle: { backgroundColor: 'transparent' },
|
|
267
|
-
}}
|
|
268
|
-
initialParams={{ showCloseButton: true }}
|
|
269
|
-
/>
|
|
270
|
-
```
|
|
81
|
+
**Purpose**: Wraps legal screens with content and styling configuration
|
|
271
82
|
|
|
272
|
-
|
|
83
|
+
**Injected Props**:
|
|
84
|
+
- `documentType`: Type of legal document
|
|
85
|
+
- `content`: Document content
|
|
86
|
+
- `title`: Document title
|
|
87
|
+
- `styles`: Custom styling
|
|
273
88
|
|
|
274
|
-
|
|
275
|
-
<Stack.Screen
|
|
276
|
-
name="Appearance"
|
|
277
|
-
component={AppearanceScreen}
|
|
278
|
-
options={{
|
|
279
|
-
headerTitle: 'Appearance',
|
|
280
|
-
headerStyle: { backgroundColor: '#fff' },
|
|
281
|
-
headerTintColor: '#000',
|
|
282
|
-
headerTitleStyle: { fontWeight: 'bold' },
|
|
283
|
-
}}
|
|
284
|
-
/>
|
|
285
|
-
```
|
|
89
|
+
**Usage**: Use for Privacy Policy, Terms of Service, EULA screens
|
|
286
90
|
|
|
287
|
-
###
|
|
91
|
+
### AboutScreenWrapper
|
|
288
92
|
|
|
289
|
-
|
|
290
|
-
<Tab.Navigator>
|
|
291
|
-
<Tab.Screen name="Home" component={HomeScreen} />
|
|
292
|
-
<Tab.Screen
|
|
293
|
-
name="Settings"
|
|
294
|
-
options={{ headerShown: false }}
|
|
295
|
-
>
|
|
296
|
-
{() => (
|
|
297
|
-
<SettingsStack>
|
|
298
|
-
<Stack.Screen
|
|
299
|
-
name="Settings"
|
|
300
|
-
component={SettingsScreenWrapper}
|
|
301
|
-
options={{ headerShown: false }}
|
|
302
|
-
/>
|
|
303
|
-
<Stack.Screen
|
|
304
|
-
name="Appearance"
|
|
305
|
-
component={AppearanceScreen}
|
|
306
|
-
/>
|
|
307
|
-
</SettingsStack>
|
|
308
|
-
)}
|
|
309
|
-
</Tab.Screen>
|
|
310
|
-
</Tab.Navigator>
|
|
311
|
-
```
|
|
93
|
+
**Purpose**: Wraps about screen with app information
|
|
312
94
|
|
|
313
|
-
|
|
95
|
+
**Injected Props**:
|
|
96
|
+
- `appInfo`: Application information object
|
|
97
|
+
- `config`: About screen configuration
|
|
314
98
|
|
|
315
|
-
|
|
316
|
-
2. **Type Safety**: Use TypeScript for navigation params
|
|
317
|
-
3. **Initial Params**: Pass configuration via initialParams
|
|
318
|
-
4. **Header Options**: Configure headers appropriately per screen
|
|
319
|
-
5. **Presentation**: Use modal presentation for settings on iOS
|
|
320
|
-
6. **Consistency**: Maintain consistent navigation patterns
|
|
99
|
+
**Usage**: Use for About screen
|
|
321
100
|
|
|
322
|
-
## Related
|
|
101
|
+
## Related Components
|
|
323
102
|
|
|
324
|
-
- **SettingsStackNavigator**: Main navigator
|
|
103
|
+
- **SettingsStackNavigator**: Main navigator that uses these wrappers
|
|
325
104
|
- **Navigation Hooks**: Navigation utility hooks
|
|
326
105
|
- **Screen Components**: Individual screen implementations
|
|
327
|
-
|
|
328
|
-
## License
|
|
329
|
-
|
|
330
|
-
MIT
|