@umituz/react-native-settings 4.20.56 → 4.20.57
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/README.md +145 -3
- package/package.json +1 -2
- package/src/application/README.md +322 -0
- package/src/domains/about/README.md +452 -0
- package/src/domains/about/presentation/hooks/README.md +350 -0
- package/src/domains/appearance/README.md +596 -0
- package/src/domains/appearance/hooks/README.md +366 -0
- package/src/domains/appearance/infrastructure/services/README.md +455 -0
- package/src/domains/cloud-sync/README.md +451 -0
- package/src/domains/cloud-sync/presentation/components/README.md +493 -0
- package/src/domains/dev/README.md +477 -0
- package/src/domains/disclaimer/README.md +421 -0
- package/src/domains/disclaimer/presentation/components/README.md +394 -0
- package/src/domains/faqs/README.md +586 -0
- package/src/domains/feedback/README.md +565 -0
- package/src/domains/feedback/presentation/hooks/README.md +428 -0
- package/src/domains/legal/README.md +549 -0
- package/src/domains/rating/README.md +452 -0
- package/src/domains/rating/presentation/components/README.md +475 -0
- package/src/domains/video-tutorials/README.md +482 -0
- package/src/domains/video-tutorials/presentation/components/README.md +433 -0
- package/src/infrastructure/README.md +509 -0
- package/src/infrastructure/repositories/README.md +475 -0
- package/src/infrastructure/services/README.md +510 -0
- package/src/presentation/components/README.md +482 -0
- package/src/presentation/components/SettingsErrorBoundary/README.md +461 -0
- package/src/presentation/components/SettingsFooter/README.md +446 -0
- package/src/presentation/components/SettingsItemCard/README.md +457 -0
- package/src/presentation/components/SettingsSection/README.md +421 -0
- package/src/presentation/hooks/README.md +413 -0
- package/src/presentation/hooks/mutations/README.md +430 -0
- package/src/presentation/hooks/queries/README.md +441 -0
- package/src/presentation/navigation/README.md +532 -0
- package/src/presentation/navigation/components/README.md +330 -0
- package/src/presentation/navigation/hooks/README.md +399 -0
- package/src/presentation/navigation/utils/README.md +442 -0
- package/src/presentation/screens/README.md +525 -0
- package/src/presentation/screens/components/SettingsContent/README.md +404 -0
- package/src/presentation/screens/components/SettingsHeader/README.md +322 -0
- package/src/presentation/screens/components/sections/CustomSettingsList/README.md +388 -0
- package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +232 -0
- package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +325 -0
- package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +480 -0
- package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +391 -0
- package/src/presentation/screens/hooks/README.md +383 -0
- package/src/presentation/screens/types/README.md +439 -0
- package/src/presentation/screens/utils/README.md +288 -0
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
# Custom Settings List
|
|
2
|
+
|
|
3
|
+
Component for rendering custom, user-defined settings sections with automatic ordering and sorting.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Custom Sections**: Add app-specific settings sections
|
|
8
|
+
- **Automatic Sorting**: Sorts sections by order property
|
|
9
|
+
- **Flexible Content**: Support for items or custom content
|
|
10
|
+
- **Full Customization**: Complete control over styling and behavior
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
This component is part of `@umituz/react-native-settings`.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Basic Usage
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { CustomSettingsList } from '@umituz/react-native-settings';
|
|
22
|
+
|
|
23
|
+
function MySettingsScreen() {
|
|
24
|
+
const customSections = [
|
|
25
|
+
{
|
|
26
|
+
id: 'integrations',
|
|
27
|
+
title: 'INTEGRATIONS',
|
|
28
|
+
order: 1,
|
|
29
|
+
items: [
|
|
30
|
+
{
|
|
31
|
+
id: 'google',
|
|
32
|
+
title: 'Google',
|
|
33
|
+
subtitle: 'Connected',
|
|
34
|
+
icon: 'logo-google',
|
|
35
|
+
onPress: () => console.log('Google settings'),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
return <CustomSettingsList customSections={customSections} />;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Props
|
|
46
|
+
|
|
47
|
+
### CustomSettingsListProps
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
|------|------|---------|-------------|
|
|
51
|
+
| `customSections` | `CustomSettingsSection[]` | `[]` | Array of custom sections |
|
|
52
|
+
|
|
53
|
+
### CustomSettingsSection
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
interface CustomSettingsSection {
|
|
57
|
+
id?: string; // Unique identifier
|
|
58
|
+
title: string; // Section title
|
|
59
|
+
order?: number; // Display order (lower = first)
|
|
60
|
+
content?: ReactNode; // Custom content (instead of items)
|
|
61
|
+
items?: CustomSettingsItem[]; // Array of items
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### CustomSettingsItem
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
interface CustomSettingsItem {
|
|
69
|
+
id?: string; // Unique identifier
|
|
70
|
+
title: string; // Item title
|
|
71
|
+
subtitle?: string; // Item description
|
|
72
|
+
icon: IconName; // Icon name
|
|
73
|
+
onPress?: () => void; // Press handler
|
|
74
|
+
rightIcon?: IconName; // Custom right icon
|
|
75
|
+
iconBgColor?: string; // Icon background color
|
|
76
|
+
iconColor?: string; // Icon color
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Examples
|
|
81
|
+
|
|
82
|
+
### Simple Section
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
const sections = [
|
|
86
|
+
{
|
|
87
|
+
title: 'PREFERENCES',
|
|
88
|
+
items: [
|
|
89
|
+
{
|
|
90
|
+
id: 'theme',
|
|
91
|
+
title: 'Theme',
|
|
92
|
+
subtitle: 'Dark',
|
|
93
|
+
icon: 'moon-outline',
|
|
94
|
+
onPress: () => navigation.navigate('Theme'),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
return <CustomSettingsList customSections={sections} />;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Multiple Sections
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
const sections = [
|
|
107
|
+
{
|
|
108
|
+
id: 'account',
|
|
109
|
+
title: 'ACCOUNT',
|
|
110
|
+
order: 1,
|
|
111
|
+
items: [
|
|
112
|
+
{
|
|
113
|
+
id: 'profile',
|
|
114
|
+
title: 'Profile',
|
|
115
|
+
icon: 'person-outline',
|
|
116
|
+
onPress: () => navigation.navigate('Profile'),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'security',
|
|
120
|
+
title: 'Security',
|
|
121
|
+
icon: 'shield-checkmark-outline',
|
|
122
|
+
onPress: () => navigation.navigate('Security'),
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'integrations',
|
|
128
|
+
title: 'INTEGRATIONS',
|
|
129
|
+
order: 2,
|
|
130
|
+
items: [
|
|
131
|
+
{
|
|
132
|
+
id: 'slack',
|
|
133
|
+
title: 'Slack',
|
|
134
|
+
subtitle: 'Connected',
|
|
135
|
+
icon: 'logo-slack',
|
|
136
|
+
onPress: () => manageSlack(),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'google',
|
|
140
|
+
title: 'Google',
|
|
141
|
+
subtitle: 'Not connected',
|
|
142
|
+
icon: 'logo-google',
|
|
143
|
+
onPress: () => connectGoogle(),
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
return <CustomSettingsList customSections={sections} />;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### With Custom Content
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
const sections = [
|
|
156
|
+
{
|
|
157
|
+
id: 'custom',
|
|
158
|
+
title: 'CUSTOM SECTION',
|
|
159
|
+
content: (
|
|
160
|
+
<View style={{ padding: 16 }}>
|
|
161
|
+
<Text>Custom content here</Text>
|
|
162
|
+
<Button title="Action" onPress={handleAction} />
|
|
163
|
+
</View>
|
|
164
|
+
),
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
return <CustomSettingsList customSections={sections} />;
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### With Ordering
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
const sections = [
|
|
175
|
+
{ title: 'SECOND', order: 2, items: [...] },
|
|
176
|
+
{ title: 'FIRST', order: 1, items: [...] },
|
|
177
|
+
{ title: 'THIRD', order: 3, items: [...] },
|
|
178
|
+
];
|
|
179
|
+
|
|
180
|
+
// Will render in order: FIRST, SECOND, THIRD
|
|
181
|
+
return <CustomSettingsList customSections={sections} />;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Mixed Items and Content
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
const sections = [
|
|
188
|
+
{
|
|
189
|
+
id: 'mixed',
|
|
190
|
+
title: 'MIXED SECTION',
|
|
191
|
+
order: 1,
|
|
192
|
+
items: [
|
|
193
|
+
{
|
|
194
|
+
id: 'item1',
|
|
195
|
+
title: 'Regular Item',
|
|
196
|
+
icon: 'settings-outline',
|
|
197
|
+
onPress: () => {},
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: 'custom-content',
|
|
203
|
+
title: 'CUSTOM CONTENT',
|
|
204
|
+
order: 2,
|
|
205
|
+
content: (
|
|
206
|
+
<View style={{ padding: 16 }}>
|
|
207
|
+
<Text>This is custom content</Text>
|
|
208
|
+
</View>
|
|
209
|
+
),
|
|
210
|
+
},
|
|
211
|
+
];
|
|
212
|
+
|
|
213
|
+
return <CustomSettingsList customSections={sections} />;
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Advanced Examples
|
|
217
|
+
|
|
218
|
+
### With Toggle Switches
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
const [integrations, setIntegrations] = useState({
|
|
222
|
+
slack: false,
|
|
223
|
+
google: true,
|
|
224
|
+
dropbox: false,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const sections = [
|
|
228
|
+
{
|
|
229
|
+
title: 'INTEGRATIONS',
|
|
230
|
+
items: [
|
|
231
|
+
{
|
|
232
|
+
id: 'slack',
|
|
233
|
+
title: 'Slack Integration',
|
|
234
|
+
subtitle: integrations.slack ? 'Enabled' : 'Disabled',
|
|
235
|
+
icon: 'logo-slack',
|
|
236
|
+
showSwitch: true,
|
|
237
|
+
switchValue: integrations.slack,
|
|
238
|
+
onSwitchChange: (value) => setIntegrations({ ...integrations, slack: value }),
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
];
|
|
243
|
+
|
|
244
|
+
return <CustomSettingsList customSections={sections} />;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### With Custom Styling
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
const sections = [
|
|
251
|
+
{
|
|
252
|
+
title: 'PRO FEATURES',
|
|
253
|
+
items: [
|
|
254
|
+
{
|
|
255
|
+
id: 'upgrade',
|
|
256
|
+
title: 'Upgrade to Pro',
|
|
257
|
+
subtitle: 'Unlock all features',
|
|
258
|
+
icon: 'star',
|
|
259
|
+
iconColor: '#FFD700',
|
|
260
|
+
iconBgColor: 'rgba(255, 215, 0, 0.1)',
|
|
261
|
+
onPress: () => navigation.navigate('Upgrade'),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: 'restore',
|
|
265
|
+
title: 'Restore Purchase',
|
|
266
|
+
subtitle: 'Already purchased?',
|
|
267
|
+
icon: 'refresh',
|
|
268
|
+
onPress: () => restorePurchase(),
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
];
|
|
273
|
+
|
|
274
|
+
return <CustomSettingsList customSections={sections} />;
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Dynamic Sections
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
function DynamicSettingsList() {
|
|
281
|
+
const [userIntegrations, setUserIntegrations] = useState([]);
|
|
282
|
+
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
loadUserIntegrations();
|
|
285
|
+
}, []);
|
|
286
|
+
|
|
287
|
+
const sections = userIntegrations.map(integration => ({
|
|
288
|
+
id: integration.id,
|
|
289
|
+
title: integration.name.toUpperCase(),
|
|
290
|
+
items: [
|
|
291
|
+
{
|
|
292
|
+
id: integration.id,
|
|
293
|
+
title: integration.displayName,
|
|
294
|
+
subtitle: integration.status,
|
|
295
|
+
icon: integration.icon,
|
|
296
|
+
onPress: () => manageIntegration(integration),
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
}));
|
|
300
|
+
|
|
301
|
+
return <CustomSettingsList customSections={sections} />;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Conditional Rendering
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
function ConditionalCustomList() {
|
|
309
|
+
const { user } = useAuth();
|
|
310
|
+
|
|
311
|
+
const sections = [];
|
|
312
|
+
|
|
313
|
+
if (user.isAdmin) {
|
|
314
|
+
sections.push({
|
|
315
|
+
title: 'ADMIN',
|
|
316
|
+
items: [
|
|
317
|
+
{
|
|
318
|
+
id: 'users',
|
|
319
|
+
title: 'Manage Users',
|
|
320
|
+
icon: 'people-outline',
|
|
321
|
+
onPress: () => navigation.navigate('AdminUsers'),
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (user.isPremium) {
|
|
328
|
+
sections.push({
|
|
329
|
+
title: 'PREMIUM',
|
|
330
|
+
items: [
|
|
331
|
+
{
|
|
332
|
+
id: 'premium-support',
|
|
333
|
+
title: 'Premium Support',
|
|
334
|
+
icon: 'headset-outline',
|
|
335
|
+
onPress: () => contactSupport(),
|
|
336
|
+
},
|
|
337
|
+
],
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return <CustomSettingsList customSections={sections} />;
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Sorting Algorithm
|
|
346
|
+
|
|
347
|
+
Sections are sorted by the `order` property:
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
const sortedSections = useMemo(() => {
|
|
351
|
+
return Array.from(customSections)
|
|
352
|
+
.sort((a, b) => (a.order ?? 999) - (b.order ?? 999));
|
|
353
|
+
}, [customSections]);
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
- Default order is `999` (appears last)
|
|
357
|
+
- Lower numbers appear first
|
|
358
|
+
- Equal order maintains array order
|
|
359
|
+
|
|
360
|
+
## Empty State
|
|
361
|
+
|
|
362
|
+
Returns `null` if no sections provided:
|
|
363
|
+
|
|
364
|
+
```tsx
|
|
365
|
+
// Renders nothing
|
|
366
|
+
<CustomSettingsList customSections={[]} />
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Best Practices
|
|
370
|
+
|
|
371
|
+
1. **Order Property**: Always set order for predictable rendering
|
|
372
|
+
2. **Unique IDs**: Provide unique IDs for all sections and items
|
|
373
|
+
3. **Consistent Icons**: Use appropriate icons for each item
|
|
374
|
+
4. **Clear Titles**: Use clear, concise titles
|
|
375
|
+
5. **Subtitles**: Provide helpful subtitles for additional context
|
|
376
|
+
6. **Navigation**: Always provide navigation handlers
|
|
377
|
+
7. **Conditional Items**: Use conditional rendering for feature-gated content
|
|
378
|
+
8. **Custom Content**: Use custom content for complex UI
|
|
379
|
+
|
|
380
|
+
## Related
|
|
381
|
+
|
|
382
|
+
- **SettingsSection**: Section wrapper component
|
|
383
|
+
- **SettingsItemCard**: Individual item component
|
|
384
|
+
- **SettingsContent**: Main content composer
|
|
385
|
+
|
|
386
|
+
## License
|
|
387
|
+
|
|
388
|
+
MIT
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# Feature Settings Section
|
|
2
|
+
|
|
3
|
+
Section component that displays appearance, language, and notification settings in the main settings screen.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Appearance Settings**: Theme and color customization
|
|
8
|
+
- **Language Selection**: Language picker with current display
|
|
9
|
+
- **Notification Settings**: Push notification preferences
|
|
10
|
+
- **Conditional Rendering**: Shows only enabled features
|
|
11
|
+
- **Internationalization**: Full i18n support
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
This component is part of `@umituz/react-native-settings`.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Basic Usage
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { FeatureSettingsSection } from '@umituz/react-native-settings';
|
|
23
|
+
|
|
24
|
+
function MySettingsScreen() {
|
|
25
|
+
const normalizedConfig = {
|
|
26
|
+
appearance: { config: {} },
|
|
27
|
+
language: { config: { route: 'LanguageSelection' } },
|
|
28
|
+
notifications: { config: {} },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const features = {
|
|
32
|
+
appearance: true,
|
|
33
|
+
language: true,
|
|
34
|
+
notifications: true,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<FeatureSettingsSection
|
|
39
|
+
normalizedConfig={normalizedConfig}
|
|
40
|
+
features={features}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Props
|
|
47
|
+
|
|
48
|
+
### FeatureSettingsSectionProps
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Description |
|
|
51
|
+
|------|------|---------|-------------|
|
|
52
|
+
| `normalizedConfig` | `NormalizedConfig` | **Required** | Normalized settings configuration |
|
|
53
|
+
| `features` | `FeatureFlags` | **Required** | Feature visibility flags |
|
|
54
|
+
|
|
55
|
+
### FeatureFlags
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface FeatureFlags {
|
|
59
|
+
appearance: boolean; // Show appearance section
|
|
60
|
+
language: boolean; // Show language selection
|
|
61
|
+
notifications: boolean; // Show notification settings
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Component Structure
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
FeatureSettingsSection
|
|
69
|
+
├── AppearanceSection (if features.appearance)
|
|
70
|
+
│ ├── Theme Mode
|
|
71
|
+
│ └── Custom Colors
|
|
72
|
+
├── Language Selection (if features.language)
|
|
73
|
+
│ └── Current Language Display
|
|
74
|
+
└── NotificationsSection (if features.notifications)
|
|
75
|
+
├── Push Notifications
|
|
76
|
+
├── Quiet Hours
|
|
77
|
+
└── Notification Categories
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Examples
|
|
81
|
+
|
|
82
|
+
### All Features Enabled
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
function FullSettingsScreen() {
|
|
86
|
+
const config = {
|
|
87
|
+
appearance: { config: { showThemeSection: true } },
|
|
88
|
+
language: { config: { route: 'LanguageSelection' } },
|
|
89
|
+
notifications: { config: { showQuietHours: true } },
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const features = {
|
|
93
|
+
appearance: true,
|
|
94
|
+
language: true,
|
|
95
|
+
notifications: true,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return <FeatureSettingsSection normalizedConfig={config} features={features} />;
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Appearance Only
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
function AppearanceOnlyScreen() {
|
|
106
|
+
const config = {
|
|
107
|
+
appearance: { config: { showColorsSection: false } },
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const features = {
|
|
111
|
+
appearance: true,
|
|
112
|
+
language: false,
|
|
113
|
+
notifications: false,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return <FeatureSettingsSection normalizedConfig={config} features={features} />;
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### With Custom Language Route
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
function CustomLanguageScreen() {
|
|
124
|
+
const config = {
|
|
125
|
+
language: {
|
|
126
|
+
config: {
|
|
127
|
+
route: 'CustomLanguagePicker',
|
|
128
|
+
showFlags: true,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const features = {
|
|
134
|
+
appearance: false,
|
|
135
|
+
language: true,
|
|
136
|
+
notifications: false,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return <FeatureSettingsSection normalizedConfig={config} features={features} />;
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Sub-Components
|
|
144
|
+
|
|
145
|
+
### AppearanceSection
|
|
146
|
+
|
|
147
|
+
Theme and appearance settings from Appearance domain.
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<AppearanceSection
|
|
151
|
+
config={{
|
|
152
|
+
title: "Appearance",
|
|
153
|
+
description: "Customize your experience",
|
|
154
|
+
showThemeSection: true,
|
|
155
|
+
showColorsSection: true,
|
|
156
|
+
}}
|
|
157
|
+
sectionTitle="APPEARANCE"
|
|
158
|
+
/>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Language Selection
|
|
162
|
+
|
|
163
|
+
Language picker item with current language display.
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
<SettingsItemCard
|
|
167
|
+
title="Language"
|
|
168
|
+
description="🇺🇸 English"
|
|
169
|
+
icon="globe-outline"
|
|
170
|
+
onPress={() => navigation.navigate('LanguageSelection')}
|
|
171
|
+
sectionTitle="LANGUAGE"
|
|
172
|
+
/>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### NotificationsSection
|
|
176
|
+
|
|
177
|
+
Notification settings from notifications domain.
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<NotificationsSection
|
|
181
|
+
config={{
|
|
182
|
+
title: "Notifications",
|
|
183
|
+
description: "Manage your preferences",
|
|
184
|
+
showQuietHours: true,
|
|
185
|
+
}}
|
|
186
|
+
/>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Feature Detection
|
|
190
|
+
|
|
191
|
+
Features are detected using `useFeatureDetection` hook:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
const features = useFeatureDetection(normalizedConfig, navigation);
|
|
195
|
+
// Returns: { appearance: boolean, language: boolean, notifications: boolean }
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Internationalization
|
|
199
|
+
|
|
200
|
+
All text uses translation keys:
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// Appearance
|
|
204
|
+
t("settings.appearance.title")
|
|
205
|
+
t("settings.appearance.description")
|
|
206
|
+
|
|
207
|
+
// Language
|
|
208
|
+
t("settings.languageSelection.title")
|
|
209
|
+
|
|
210
|
+
// Notifications
|
|
211
|
+
t("settings.notifications.title")
|
|
212
|
+
t("settings.notifications.description")
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Best Practices
|
|
216
|
+
|
|
217
|
+
1. **Normalize Config**: Always normalize config before passing
|
|
218
|
+
2. **Feature Detection**: Use feature detection for conditional rendering
|
|
219
|
+
3. **Translation Keys**: Provide all required translation keys
|
|
220
|
+
4. **Navigation Routes**: Define custom routes for language selection
|
|
221
|
+
5. **Feature Flags**: Use feature flags to control visibility
|
|
222
|
+
6. **Lazy Loading**: Load sections only when needed
|
|
223
|
+
|
|
224
|
+
## Related
|
|
225
|
+
|
|
226
|
+
- **Appearance Domain**: Theme customization
|
|
227
|
+
- **Localization**: Language management
|
|
228
|
+
- **Notifications**: Notification preferences
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
MIT
|