@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,525 +1,74 @@
|
|
|
1
1
|
# Settings Screen
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Modular Architecture**: Composable sections for different feature groups
|
|
8
|
-
- **User Profile Header**: Optional user profile display
|
|
9
|
-
- **Feature Detection**: Automatically detect available features
|
|
10
|
-
- **Custom Sections**: Support for custom settings sections
|
|
11
|
-
- **Error Boundaries**: Built-in error handling
|
|
12
|
-
- **Responsive Design**: Adapts to different screen sizes
|
|
13
|
-
- **Theme Support**: Automatic light/dark theme support
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
This component is part of `@umituz/react-native-settings`:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install @umituz/react-native-settings
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
### Basic Usage
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import { SettingsScreen } from '@umituz/react-native-settings';
|
|
29
|
-
|
|
30
|
-
function MySettingsScreen() {
|
|
31
|
-
return (
|
|
32
|
-
<SettingsScreen />
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### With Configuration
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
import { SettingsScreen } from '@umituz/react-native-settings';
|
|
41
|
-
|
|
42
|
-
function ConfiguredSettingsScreen() {
|
|
43
|
-
const config = {
|
|
44
|
-
appearance: true,
|
|
45
|
-
language: false,
|
|
46
|
-
notifications: true,
|
|
47
|
-
privacy: true,
|
|
48
|
-
support: true,
|
|
49
|
-
about: true,
|
|
50
|
-
legal: true,
|
|
51
|
-
feedback: true,
|
|
52
|
-
faqs: true,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<SettingsScreen
|
|
57
|
-
config={config}
|
|
58
|
-
showUserProfile={true}
|
|
59
|
-
userProfile={{
|
|
60
|
-
displayName: 'John Doe',
|
|
61
|
-
userId: 'user123',
|
|
62
|
-
avatarUrl: 'https://example.com/avatar.jpg',
|
|
63
|
-
}}
|
|
64
|
-
showFooter={true}
|
|
65
|
-
appVersion="1.0.0"
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Props
|
|
72
|
-
|
|
73
|
-
### SettingsScreenProps
|
|
74
|
-
|
|
75
|
-
| Prop | Type | Default | Description |
|
|
76
|
-
|------|------|---------|-------------|
|
|
77
|
-
| `config` | `SettingsConfig` | `{}` | Configuration for which features to show |
|
|
78
|
-
| `showUserProfile` | `boolean` | `undefined` | Show user profile header |
|
|
79
|
-
| `userProfile` | `UserProfileProps` | `undefined` | User profile data |
|
|
80
|
-
| `showFooter` | `boolean` | `true` | Show footer with version |
|
|
81
|
-
| `footerText` | `string` | `undefined` | Custom footer text |
|
|
82
|
-
| `appVersion` | `string` | `undefined` | App version number |
|
|
83
|
-
| `customSections` | `CustomSettingsSection[]` | `[]` | Custom sections to render |
|
|
84
|
-
| `showCloseButton` | `boolean` | `false` | Show close button in header |
|
|
85
|
-
| `onClose` | `() => void` | `undefined` | Close button handler |
|
|
86
|
-
| `featureOptions` | `FeatureOptions` | `undefined` | Feature detection options |
|
|
87
|
-
| `devSettings` | `DevSettingsProps` | `undefined` | Dev settings (DEV mode only) |
|
|
88
|
-
|
|
89
|
-
### SettingsConfig
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
interface SettingsConfig {
|
|
93
|
-
appearance?: boolean; // Show appearance settings
|
|
94
|
-
language?: boolean; // Show language selection
|
|
95
|
-
notifications?: boolean; // Show notification settings
|
|
96
|
-
privacy?: boolean; // Show privacy settings
|
|
97
|
-
support?: boolean; // Show support section
|
|
98
|
-
about?: boolean; // Show about section
|
|
99
|
-
legal?: boolean; // Show legal section
|
|
100
|
-
feedback?: boolean; // Show feedback section
|
|
101
|
-
faqs?: boolean; // Show FAQ section
|
|
102
|
-
cloudSync?: boolean; // Show cloud sync settings
|
|
103
|
-
// ... more feature flags
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### UserProfileProps
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
interface UserProfileProps {
|
|
111
|
-
displayName?: string; // User display name
|
|
112
|
-
userId?: string; // User ID
|
|
113
|
-
isAnonymous?: boolean; // Anonymous user flag
|
|
114
|
-
avatarUrl?: string; // Avatar image URL
|
|
115
|
-
accountSettingsRoute?: string; // Navigation route
|
|
116
|
-
onPress?: () => void; // Custom press handler
|
|
117
|
-
anonymousDisplayName?: string; // Anonymous display name
|
|
118
|
-
avatarServiceUrl?: string; // Avatar service base URL
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Examples
|
|
123
|
-
|
|
124
|
-
### Minimal Settings
|
|
125
|
-
|
|
126
|
-
```tsx
|
|
127
|
-
import { SettingsScreen } from '@umituz/react-native-settings';
|
|
128
|
-
|
|
129
|
-
export default function MinimalSettings() {
|
|
130
|
-
return <SettingsScreen />;
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Custom Configuration
|
|
135
|
-
|
|
136
|
-
```tsx
|
|
137
|
-
function CustomSettings() {
|
|
138
|
-
return (
|
|
139
|
-
<SettingsScreen
|
|
140
|
-
config={{
|
|
141
|
-
appearance: true,
|
|
142
|
-
notifications: true,
|
|
143
|
-
privacy: true,
|
|
144
|
-
support: true,
|
|
145
|
-
about: true,
|
|
146
|
-
}}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### With User Profile
|
|
153
|
-
|
|
154
|
-
```tsx
|
|
155
|
-
function SettingsWithProfile() {
|
|
156
|
-
return (
|
|
157
|
-
<SettingsScreen
|
|
158
|
-
showUserProfile={true}
|
|
159
|
-
userProfile={{
|
|
160
|
-
displayName: 'Jane Doe',
|
|
161
|
-
userId: 'user456',
|
|
162
|
-
avatarUrl: 'https://api.example.com/avatars/user456.jpg',
|
|
163
|
-
onPress: () => navigation.navigate('AccountSettings'),
|
|
164
|
-
}}
|
|
165
|
-
/>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Anonymous User
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
function SettingsForAnonymous() {
|
|
174
|
-
return (
|
|
175
|
-
<SettingsScreen
|
|
176
|
-
showUserProfile={true}
|
|
177
|
-
userProfile={{
|
|
178
|
-
isAnonymous: true,
|
|
179
|
-
anonymousDisplayName: 'Guest User',
|
|
180
|
-
onPress: () => navigation.navigate('SignUp'),
|
|
181
|
-
}}
|
|
182
|
-
/>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### With Custom Sections
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
function SettingsWithCustomSections() {
|
|
191
|
-
const customSections = [
|
|
192
|
-
{
|
|
193
|
-
title: 'INTEGRATIONS',
|
|
194
|
-
items: [
|
|
195
|
-
{
|
|
196
|
-
icon: 'logo-google',
|
|
197
|
-
title: 'Google',
|
|
198
|
-
description: 'Connected',
|
|
199
|
-
showSwitch: true,
|
|
200
|
-
switchValue: googleEnabled,
|
|
201
|
-
onSwitchChange: setGoogleEnabled,
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
icon: 'logo-apple',
|
|
205
|
-
title: 'Apple',
|
|
206
|
-
description: 'Not connected',
|
|
207
|
-
onPress: () => connectApple(),
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
},
|
|
211
|
-
];
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
<SettingsScreen
|
|
215
|
-
customSections={customSections}
|
|
216
|
-
/>
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
```
|
|
3
|
+
## Purpose
|
|
220
4
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
```tsx
|
|
224
|
-
function ModalSettingsScreen() {
|
|
225
|
-
return (
|
|
226
|
-
<SettingsScreen
|
|
227
|
-
showCloseButton={true}
|
|
228
|
-
onClose={() => navigation.goBack()}
|
|
229
|
-
/>
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### With Dev Settings
|
|
235
|
-
|
|
236
|
-
```tsx
|
|
237
|
-
import { DevSettingsSection } from '@umituz/react-native-settings';
|
|
238
|
-
|
|
239
|
-
function SettingsWithDevTools() {
|
|
240
|
-
return (
|
|
241
|
-
<SettingsScreen
|
|
242
|
-
devSettings={{
|
|
243
|
-
enabled: true,
|
|
244
|
-
onAfterClear: async () => {
|
|
245
|
-
await resetApp();
|
|
246
|
-
Updates.reloadAsync();
|
|
247
|
-
},
|
|
248
|
-
}}
|
|
249
|
-
/>
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### Complete Example
|
|
255
|
-
|
|
256
|
-
```tsx
|
|
257
|
-
import React from 'react';
|
|
258
|
-
import { SettingsScreen } from '@umituz/react-native-settings';
|
|
259
|
-
import { useAuth } from './auth';
|
|
260
|
-
|
|
261
|
-
export default function CompleteSettingsScreen() {
|
|
262
|
-
const { user } = useAuth();
|
|
263
|
-
|
|
264
|
-
const config = {
|
|
265
|
-
appearance: true,
|
|
266
|
-
notifications: true,
|
|
267
|
-
privacy: true,
|
|
268
|
-
support: true,
|
|
269
|
-
about: true,
|
|
270
|
-
legal: true,
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
const customSections = [
|
|
274
|
-
{
|
|
275
|
-
title: 'PRO FEATURES',
|
|
276
|
-
items: [
|
|
277
|
-
{
|
|
278
|
-
icon: 'star-outline',
|
|
279
|
-
title: 'Upgrade to Pro',
|
|
280
|
-
description: 'Unlock all features',
|
|
281
|
-
onPress: () => navigation.navigate('Upgrade'),
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
];
|
|
286
|
-
|
|
287
|
-
return (
|
|
288
|
-
<SettingsScreen
|
|
289
|
-
config={config}
|
|
290
|
-
showUserProfile={true}
|
|
291
|
-
userProfile={{
|
|
292
|
-
displayName: user?.displayName,
|
|
293
|
-
userId: user?.uid,
|
|
294
|
-
avatarUrl: user?.photoURL,
|
|
295
|
-
onPress: () => navigation.navigate('Account'),
|
|
296
|
-
}}
|
|
297
|
-
showFooter={true}
|
|
298
|
-
footerText={`Version ${Constants.expoConfig.version}`}
|
|
299
|
-
customSections={customSections}
|
|
300
|
-
showCloseButton={true}
|
|
301
|
-
onClose={() => navigation.goBack()}
|
|
302
|
-
devSettings={{
|
|
303
|
-
onAfterClear: async () => {
|
|
304
|
-
await signOut();
|
|
305
|
-
navigation.reset('Welcome');
|
|
306
|
-
},
|
|
307
|
-
}}
|
|
308
|
-
/>
|
|
309
|
-
);
|
|
310
|
-
}
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
## Component Structure
|
|
314
|
-
|
|
315
|
-
The SettingsScreen is composed of several sub-components:
|
|
316
|
-
|
|
317
|
-
```
|
|
318
|
-
SettingsScreen
|
|
319
|
-
├── SettingsHeader # Header with title and close button
|
|
320
|
-
└── SettingsContent # Main content area
|
|
321
|
-
├── UserProfileHeader # User profile display (optional)
|
|
322
|
-
├── Feature Sections # Dynamic sections based on config
|
|
323
|
-
│ ├── AppearanceSection
|
|
324
|
-
│ ├── IdentitySection
|
|
325
|
-
│ ├── NotificationSection
|
|
326
|
-
│ ├── PrivacySection
|
|
327
|
-
│ ├── SupportSection
|
|
328
|
-
│ ├── AboutSection
|
|
329
|
-
│ └── LegalSection
|
|
330
|
-
├── Custom Sections # User-defined sections
|
|
331
|
-
├── Dev Settings # Development tools (DEV only)
|
|
332
|
-
└── SettingsFooter # App version footer
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
## Custom Sections
|
|
336
|
-
|
|
337
|
-
You can add custom settings sections using the `customSections` prop:
|
|
338
|
-
|
|
339
|
-
```tsx
|
|
340
|
-
const customSections: CustomSettingsSection[] = [
|
|
341
|
-
{
|
|
342
|
-
title: 'SECTION TITLE',
|
|
343
|
-
items: [
|
|
344
|
-
{
|
|
345
|
-
icon: 'icon-name',
|
|
346
|
-
title: 'Item Title',
|
|
347
|
-
description: 'Optional description',
|
|
348
|
-
onPress: () => {},
|
|
349
|
-
// OR
|
|
350
|
-
showSwitch: true,
|
|
351
|
-
switchValue: true,
|
|
352
|
-
onSwitchChange: (value) => {},
|
|
353
|
-
},
|
|
354
|
-
],
|
|
355
|
-
},
|
|
356
|
-
];
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
### Custom Section Types
|
|
360
|
-
|
|
361
|
-
**Navigation Items:**
|
|
362
|
-
|
|
363
|
-
```tsx
|
|
364
|
-
{
|
|
365
|
-
icon: 'chevron-forward-outline',
|
|
366
|
-
title: 'Advanced Settings',
|
|
367
|
-
onPress: () => navigation.navigate('Advanced'),
|
|
368
|
-
}
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
**Toggle Items:**
|
|
372
|
-
|
|
373
|
-
```tsx
|
|
374
|
-
{
|
|
375
|
-
icon: 'notifications-outline',
|
|
376
|
-
title: 'Enable Feature',
|
|
377
|
-
showSwitch: true,
|
|
378
|
-
switchValue: enabled,
|
|
379
|
-
onSwitchChange: setEnabled,
|
|
380
|
-
}
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
**Info Items:**
|
|
384
|
-
|
|
385
|
-
```tsx
|
|
386
|
-
{
|
|
387
|
-
icon: 'information-circle-outline',
|
|
388
|
-
title: 'App Version',
|
|
389
|
-
description: '1.0.0 (123)',
|
|
390
|
-
}
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
## Feature Detection
|
|
394
|
-
|
|
395
|
-
The screen uses feature detection to show/hide sections:
|
|
396
|
-
|
|
397
|
-
```tsx
|
|
398
|
-
const featureOptions = {
|
|
399
|
-
notificationServiceAvailable: true, // Enable notification features
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
<SettingsScreen
|
|
403
|
-
featureOptions={featureOptions}
|
|
404
|
-
/>
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
## Styling
|
|
408
|
-
|
|
409
|
-
All styling uses the design system tokens:
|
|
410
|
-
|
|
411
|
-
```tsx
|
|
412
|
-
// Theme integration handled automatically
|
|
413
|
-
// Supports light/dark mode switching
|
|
414
|
-
// Responsive design for all screen sizes
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
## Error Handling
|
|
5
|
+
Main settings screen component with modular architecture for displaying app settings in an organized, user-friendly interface.
|
|
418
6
|
|
|
419
|
-
|
|
7
|
+
## File Paths
|
|
420
8
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
9
|
+
- **Screen**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/SettingsScreen.tsx`
|
|
10
|
+
- **Components**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/`
|
|
11
|
+
- **Hooks**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/hooks/`
|
|
12
|
+
- **Utils**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/utils/`
|
|
13
|
+
- **Types**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/types/`
|
|
426
14
|
|
|
427
|
-
|
|
15
|
+
## Strategy
|
|
428
16
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
/>
|
|
435
|
-
```
|
|
17
|
+
1. **Modular Architecture**: Composable sections for different feature groups (appearance, language, notifications, etc.)
|
|
18
|
+
2. **Configuration-Driven**: Uses configuration object to control which features and sections appear
|
|
19
|
+
3. **Feature Detection**: Automatically detects available screens and features
|
|
20
|
+
4. **User Profile Integration**: Optional user profile header for authenticated users
|
|
21
|
+
5. **Custom Sections**: Support for app-specific settings sections
|
|
436
22
|
|
|
437
|
-
##
|
|
23
|
+
## Restrictions (Forbidden)
|
|
438
24
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
5. **Error Boundaries**: Don't wrap in additional error boundaries
|
|
444
|
-
6. **Navigation**: Provide proper navigation handlers
|
|
445
|
-
7. **Dev Settings**: Include dev tools for development builds
|
|
446
|
-
8. **Feature Flags**: Use feature flags for experimental features
|
|
25
|
+
### DO NOT
|
|
26
|
+
- ❌ DO NOT manually manage individual section rendering (use config object)
|
|
27
|
+
- ❌ DO NOT hardcode section order or visibility
|
|
28
|
+
- ❌ DO NOT bypass the configuration system
|
|
447
29
|
|
|
448
|
-
|
|
30
|
+
### NEVER
|
|
31
|
+
- ❌ NEVER wrap SettingsScreen in additional error boundaries (already included)
|
|
32
|
+
- ❌ NEVER modify sections directly without updating config
|
|
33
|
+
- ❌ NEVER use SettingsScreen for non-settings content
|
|
449
34
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
35
|
+
### AVOID
|
|
36
|
+
- ❌ AVOID mixing configuration methods (stick to config object)
|
|
37
|
+
- ❌ AVOID showing too many sections at once (6-8 maximum recommended)
|
|
38
|
+
- ❌ AVOID inconsistent section ordering across different app versions
|
|
453
39
|
|
|
454
|
-
|
|
455
|
-
it('renders with default config', () => {
|
|
456
|
-
const { getByText } = render(<SettingsScreen />);
|
|
457
|
-
expect(getByText(/settings/i)).toBeTruthy();
|
|
458
|
-
});
|
|
40
|
+
## Rules (Mandatory)
|
|
459
41
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
/>
|
|
466
|
-
);
|
|
467
|
-
expect(getByText('John Doe')).toBeTruthy();
|
|
468
|
-
});
|
|
42
|
+
### ALWAYS
|
|
43
|
+
- ✅ ALWAYS use the config prop to control which sections appear
|
|
44
|
+
- ✅ ALWAYS normalize config before passing to screen components
|
|
45
|
+
- ✅ ALWAYS provide app version in footer for support purposes
|
|
46
|
+
- ✅ ALWAYS test with different configuration combinations
|
|
469
47
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
items: [
|
|
475
|
-
{
|
|
476
|
-
icon: 'star',
|
|
477
|
-
title: 'Custom Item',
|
|
478
|
-
onPress: () => {},
|
|
479
|
-
},
|
|
480
|
-
],
|
|
481
|
-
},
|
|
482
|
-
];
|
|
48
|
+
### MUST
|
|
49
|
+
- ✅ MUST include dev settings in development builds
|
|
50
|
+
- ✅ MUST handle empty state gracefully when no features are enabled
|
|
51
|
+
- ✅ MUST ensure proper navigation handlers are provided
|
|
483
52
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
|
-
```
|
|
53
|
+
### SHOULD
|
|
54
|
+
- ✅ SHOULD show user profile header for authenticated users
|
|
55
|
+
- ✅ SHOULD use custom sections for app-specific settings
|
|
56
|
+
- ✅ SHOULD include feature flags for experimental features
|
|
491
57
|
|
|
492
|
-
##
|
|
58
|
+
## AI Agent Guidelines
|
|
493
59
|
|
|
494
|
-
|
|
60
|
+
1. **File Reference**: When modifying screen behavior, refer to `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/SettingsScreen.tsx`
|
|
61
|
+
2. **Configuration**: Always use `normalizeSettingsConfig()` before passing config to the screen
|
|
62
|
+
3. **Feature Detection**: Use `useFeatureDetection()` hook to automatically detect available features
|
|
63
|
+
4. **Custom Sections**: Add app-specific settings via `customSections` prop, not by modifying core sections
|
|
64
|
+
5. **Navigation**: Ensure all section press handlers have proper navigation callbacks
|
|
495
65
|
|
|
496
|
-
|
|
497
|
-
presentation/screens/
|
|
498
|
-
├── SettingsScreen.tsx # Main screen component
|
|
499
|
-
├── components/
|
|
500
|
-
│ ├── SettingsHeader.tsx # Header component
|
|
501
|
-
│ ├── SettingsContent.tsx # Content composer
|
|
502
|
-
│ └── sections/ # Section components
|
|
503
|
-
│ ├── AppearanceSection.tsx
|
|
504
|
-
│ ├── IdentitySection.tsx
|
|
505
|
-
│ ├── NotificationSection.tsx
|
|
506
|
-
│ ├── PrivacySection.tsx
|
|
507
|
-
│ ├── SupportSection.tsx
|
|
508
|
-
│ ├── AboutSection.tsx
|
|
509
|
-
│ └── LegalSection.tsx
|
|
510
|
-
├── hooks/
|
|
511
|
-
│ └── useFeatureDetection.ts # Feature detection logic
|
|
512
|
-
├── utils/
|
|
513
|
-
│ └── normalizeConfig.ts # Config normalization
|
|
514
|
-
└── types/ # TypeScript definitions
|
|
515
|
-
```
|
|
66
|
+
## Component Reference
|
|
516
67
|
|
|
517
|
-
|
|
68
|
+
Sub-components:
|
|
69
|
+
- **SettingsHeader**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/SettingsHeader/SettingsHeader.tsx`
|
|
70
|
+
- **SettingsContent**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/SettingsContent/SettingsContent.tsx`
|
|
518
71
|
|
|
72
|
+
Related:
|
|
519
73
|
- **Core Components**: SettingsItemCard, SettingsSection
|
|
520
|
-
- **
|
|
521
|
-
- **Design System**: UI components and theming
|
|
522
|
-
|
|
523
|
-
## License
|
|
524
|
-
|
|
525
|
-
MIT
|
|
74
|
+
- **Feature Sections**: AppearanceSection, IdentitySection, NotificationSection, PrivacySection, SupportSection, AboutSection, LegalSection
|