@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
|
@@ -2,214 +2,125 @@
|
|
|
2
2
|
|
|
3
3
|
Section component that displays appearance, language, and notification settings in the main settings screen.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Purpose
|
|
6
6
|
|
|
7
|
-
-
|
|
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
|
|
7
|
+
Provides a unified section component that aggregates multiple feature-related settings (appearance, language, notifications) into a single, configurable display area with conditional rendering based on feature flags.
|
|
12
8
|
|
|
13
|
-
##
|
|
9
|
+
## File Paths
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
}
|
|
11
|
+
```
|
|
12
|
+
src/presentation/screens/components/sections/FeatureSettingsSection/
|
|
13
|
+
├── index.ts # Main section component
|
|
14
|
+
└── README.md # This file
|
|
44
15
|
```
|
|
45
16
|
|
|
46
|
-
##
|
|
17
|
+
## Strategy
|
|
47
18
|
|
|
48
|
-
|
|
19
|
+
1. **Conditional Rendering**: Show only enabled features based on feature flags
|
|
20
|
+
2. **Composition**: Compose multiple domain-specific sections into one
|
|
21
|
+
3. **Configuration Driven**: Use normalized config to determine section behavior
|
|
22
|
+
4. **Feature Detection**: Automatically detect available features
|
|
23
|
+
5. **Internationalization**: Full i18n support for all text
|
|
49
24
|
|
|
50
|
-
|
|
51
|
-
|------|------|---------|-------------|
|
|
52
|
-
| `normalizedConfig` | `NormalizedConfig` | **Required** | Normalized settings configuration |
|
|
53
|
-
| `features` | `FeatureFlags` | **Required** | Feature visibility flags |
|
|
25
|
+
## Restrictions
|
|
54
26
|
|
|
55
|
-
###
|
|
27
|
+
### DO NOT
|
|
56
28
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
```
|
|
29
|
+
- ❌ DO NOT hardcode feature visibility; use feature flags
|
|
30
|
+
- ❌ DO NOT mix concerns; delegate to domain sections
|
|
31
|
+
- ❌ DO NOT assume all features are enabled
|
|
32
|
+
- ❌ DO NOT include business logic in this component
|
|
33
|
+
- ❌ DO NOT duplicate section implementations
|
|
64
34
|
|
|
65
|
-
|
|
35
|
+
### NEVER
|
|
66
36
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
```
|
|
37
|
+
- ❌ NEVER bypass feature detection
|
|
38
|
+
- ❌ EVER hardcode navigation routes
|
|
39
|
+
- ❌ EVER assume config is always valid
|
|
40
|
+
- ❌ EVER render sections that are disabled
|
|
79
41
|
|
|
80
|
-
|
|
42
|
+
### AVOID
|
|
81
43
|
|
|
82
|
-
|
|
44
|
+
- ❌ AVOID complex state management; lift to parent
|
|
45
|
+
- ❌ AVOID deep component nesting
|
|
46
|
+
- ❌ AVOID duplicating translation keys
|
|
47
|
+
- ❌ AVOID tight coupling to specific domains
|
|
83
48
|
|
|
84
|
-
|
|
85
|
-
function FullSettingsScreen() {
|
|
86
|
-
const config = {
|
|
87
|
-
appearance: { config: { showThemeSection: true } },
|
|
88
|
-
language: { config: { route: 'LanguageSelection' } },
|
|
89
|
-
notifications: { config: { showQuietHours: true } },
|
|
90
|
-
};
|
|
49
|
+
## Rules
|
|
91
50
|
|
|
92
|
-
|
|
93
|
-
appearance: true,
|
|
94
|
-
language: true,
|
|
95
|
-
notifications: true,
|
|
96
|
-
};
|
|
51
|
+
### ALWAYS
|
|
97
52
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
53
|
+
- ✅ ALWAYS normalize config before passing to sections
|
|
54
|
+
- ✅ ALWAYS use feature detection for conditional rendering
|
|
55
|
+
- ✅ ALWAYS provide translation keys for all text
|
|
56
|
+
- ✅ ALWAYS respect feature flags
|
|
57
|
+
- ✅ ALWAYS delegate to domain-specific components
|
|
101
58
|
|
|
102
|
-
###
|
|
59
|
+
### MUST
|
|
103
60
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
};
|
|
61
|
+
- ✅ MUST validate config before rendering
|
|
62
|
+
- ✅ MUST handle missing features gracefully
|
|
63
|
+
- ✅ MUST provide navigation for interactive items
|
|
64
|
+
- ✅ MUST maintain consistent styling
|
|
109
65
|
|
|
110
|
-
|
|
111
|
-
appearance: true,
|
|
112
|
-
language: false,
|
|
113
|
-
notifications: false,
|
|
114
|
-
};
|
|
66
|
+
### SHOULD
|
|
115
67
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
68
|
+
- ✅ SHOULD use lazy loading for sections
|
|
69
|
+
- ✅ SHOULD provide loading states
|
|
70
|
+
- ✅ SHOULD handle errors gracefully
|
|
71
|
+
- ✅ SHOULD maintain consistent spacing
|
|
119
72
|
|
|
120
|
-
|
|
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
|
-
```
|
|
73
|
+
## AI Agent Guidelines
|
|
142
74
|
|
|
143
|
-
|
|
75
|
+
1. **When adding new features**: Add feature detection and conditional rendering
|
|
76
|
+
2. **When modifying layout**: Maintain consistent spacing and alignment
|
|
77
|
+
3. **When updating translations**: Add all required translation keys
|
|
78
|
+
4. **When debugging**: Check feature flags and normalized config
|
|
79
|
+
5. **When adding sections**: Follow existing section composition pattern
|
|
144
80
|
|
|
145
|
-
|
|
81
|
+
## Component Reference
|
|
146
82
|
|
|
147
|
-
|
|
83
|
+
### FeatureSettingsSection
|
|
148
84
|
|
|
149
|
-
|
|
150
|
-
<AppearanceSection
|
|
151
|
-
config={{
|
|
152
|
-
title: "Appearance",
|
|
153
|
-
description: "Customize your experience",
|
|
154
|
-
showThemeSection: true,
|
|
155
|
-
showColorsSection: true,
|
|
156
|
-
}}
|
|
157
|
-
sectionTitle="APPEARANCE"
|
|
158
|
-
/>
|
|
159
|
-
```
|
|
85
|
+
Main section component that displays multiple feature settings.
|
|
160
86
|
|
|
161
|
-
|
|
87
|
+
**Location**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/sections/FeatureSettingsSection/index.tsx`
|
|
162
88
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<SettingsItemCard
|
|
167
|
-
title="Language"
|
|
168
|
-
description="🇺🇸 English"
|
|
169
|
-
icon="globe-outline"
|
|
170
|
-
onPress={() => navigation.navigate('LanguageSelection')}
|
|
171
|
-
sectionTitle="LANGUAGE"
|
|
172
|
-
/>
|
|
173
|
-
```
|
|
89
|
+
**Props**:
|
|
90
|
+
- `normalizedConfig: NormalizedConfig` - Normalized settings configuration
|
|
91
|
+
- `features: FeatureFlags` - Feature visibility flags
|
|
174
92
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
```tsx
|
|
180
|
-
<NotificationsSection
|
|
181
|
-
config={{
|
|
182
|
-
title: "Notifications",
|
|
183
|
-
description: "Manage your preferences",
|
|
184
|
-
showQuietHours: true,
|
|
185
|
-
}}
|
|
186
|
-
/>
|
|
187
|
-
```
|
|
93
|
+
**Sub-Components**:
|
|
94
|
+
- AppearanceSection (if features.appearance)
|
|
95
|
+
- Language Selection (if features.language)
|
|
96
|
+
- NotificationsSection (if features.notifications)
|
|
188
97
|
|
|
189
98
|
## Feature Detection
|
|
190
99
|
|
|
191
100
|
Features are detected using `useFeatureDetection` hook:
|
|
101
|
+
- Returns: `{ appearance: boolean, language: boolean, notifications: boolean }`
|
|
102
|
+
- Checks config availability and route definitions
|
|
192
103
|
|
|
193
|
-
|
|
194
|
-
const features = useFeatureDetection(normalizedConfig, navigation);
|
|
195
|
-
// Returns: { appearance: boolean, language: boolean, notifications: boolean }
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
## Internationalization
|
|
104
|
+
## Configuration Structure
|
|
199
105
|
|
|
200
|
-
|
|
106
|
+
### NormalizedConfig
|
|
201
107
|
|
|
202
108
|
```typescript
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
109
|
+
interface NormalizedConfig {
|
|
110
|
+
appearance?: { config: AppearanceConfig };
|
|
111
|
+
language?: { config: LanguageConfig };
|
|
112
|
+
notifications?: { config: NotificationsConfig };
|
|
113
|
+
}
|
|
114
|
+
```
|
|
206
115
|
|
|
207
|
-
|
|
208
|
-
t("settings.languageSelection.title")
|
|
116
|
+
### FeatureFlags
|
|
209
117
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
118
|
+
```typescript
|
|
119
|
+
interface FeatureFlags {
|
|
120
|
+
appearance: boolean;
|
|
121
|
+
language: boolean;
|
|
122
|
+
notifications: boolean;
|
|
123
|
+
}
|
|
213
124
|
```
|
|
214
125
|
|
|
215
126
|
## Best Practices
|
|
@@ -221,12 +132,6 @@ t("settings.notifications.description")
|
|
|
221
132
|
5. **Feature Flags**: Use feature flags to control visibility
|
|
222
133
|
6. **Lazy Loading**: Load sections only when needed
|
|
223
134
|
|
|
224
|
-
## Related
|
|
225
|
-
|
|
226
|
-
- **Appearance Domain**: Theme customization
|
|
227
|
-
- **Localization**: Language management
|
|
228
|
-
- **Notifications**: Notification preferences
|
|
229
|
-
|
|
230
135
|
## License
|
|
231
136
|
|
|
232
137
|
MIT
|
|
@@ -2,324 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
Section component that displays user identity-related settings including About and Legal information.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Purpose
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Legal Section**: Privacy policy, terms of service, legal documents
|
|
9
|
-
- **Conditional Rendering**: Shows only enabled sections
|
|
10
|
-
- **Internationalization**: Full i18n support
|
|
7
|
+
Provides a dedicated section for user identity settings, organizing app information (About) and legal documentation (Privacy Policy, Terms of Service) into a cohesive user interface. Enables conditional rendering of these sections based on feature flags.
|
|
11
8
|
|
|
12
|
-
##
|
|
9
|
+
## File Paths
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
- **Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/sections/IdentitySettingsSection/IdentitySettingsSection.tsx`
|
|
12
|
+
- **About Domain**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domain/about/`
|
|
13
|
+
- **Legal Domain**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domain/legal/`
|
|
15
14
|
|
|
16
|
-
##
|
|
15
|
+
## Strategy
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
1. **Conditional Rendering**: Render AboutSection and LegalSection only when their respective feature flags are enabled
|
|
18
|
+
2. **Domain Separation**: Delegate About section rendering to About domain components and Legal section to Legal domain components
|
|
19
|
+
3. **Configuration Normalization**: Accept normalized configuration objects to ensure consistent data structure across features
|
|
20
|
+
4. **Internationalization Support**: Use translation keys for all user-facing text to support multiple languages
|
|
21
|
+
5. **Flexible Legal Documents**: Support both URL-based and inline content for legal documents
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
import { IdentitySettingsSection } from '@umituz/react-native-settings';
|
|
23
|
+
## Restrictions
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
- ❌ DO NOT hardcode legal document URLs or content within the component
|
|
26
|
+
- ❌ DO NOT render sections that are disabled in feature flags
|
|
27
|
+
- ❌ NEVER bypass the normalized configuration structure
|
|
28
|
+
- ❌ AVOID adding non-identity related features to this section
|
|
29
|
+
- ❌ DO NOT duplicate About or Legal domain logic within this component
|
|
30
|
+
- ❌ NEVER assume all features are enabled; always check feature flags
|
|
31
|
+
- ❌ AVOID mixing identity settings with other feature categories
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
about: true,
|
|
31
|
-
legal: true,
|
|
32
|
-
};
|
|
33
|
+
## Rules
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
- ✅ MUST receive both normalizedConfig and features as required props
|
|
36
|
+
- ✅ ALWAYS delegate to AboutSection component for About feature rendering
|
|
37
|
+
- ✅ ALWAYS delegate to LegalSection component for Legal feature rendering
|
|
38
|
+
- ✅ MUST support internationalization for all text content
|
|
39
|
+
- ✅ SHOULD maintain separation of concerns between About and Legal features
|
|
40
|
+
- ✅ MUST handle cases where one or both features are disabled
|
|
41
|
+
- ✅ ALWAYS use translation keys for consistent localization
|
|
42
|
+
- ✅ MUST preserve the order: About section first, then Legal section
|
|
42
43
|
|
|
43
|
-
##
|
|
44
|
+
## AI Agent Guidelines
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
When working with IdentitySettingsSection:
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|------|------|---------|-------------|
|
|
49
|
-
| `normalizedConfig` | `NormalizedConfig` | **Required** | Normalized settings configuration |
|
|
50
|
-
| `features` | `FeatureFlags` | **Required** | Feature visibility flags |
|
|
48
|
+
1. **Adding Identity Features**: Only add features that relate to user identity (About, Legal, Account, Profile). Do not add non-identity features.
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
2. **Configuration Structure**: Always use the normalized configuration format. Do not introduce new configuration shapes without updating the normalization logic.
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
interface FeatureFlags {
|
|
56
|
-
about: boolean; // Show about section
|
|
57
|
-
legal: boolean; // Show legal section
|
|
58
|
-
}
|
|
59
|
-
```
|
|
52
|
+
3. **Feature Flag Logic**: When adding new sub-features, implement corresponding feature flags to control visibility.
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
4. **Domain Delegation**: Always delegate rendering to domain-specific components (AboutSection, LegalSection). Do not reimplement domain logic.
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
IdentitySettingsSection
|
|
65
|
-
├── AboutSection (if features.about)
|
|
66
|
-
│ ├── App Information
|
|
67
|
-
│ ├── Version
|
|
68
|
-
│ ├── Developer
|
|
69
|
-
│ └── Contact
|
|
70
|
-
└── LegalSection (if features.legal)
|
|
71
|
-
├── Privacy Policy
|
|
72
|
-
├── Terms of Service
|
|
73
|
-
└── EULA (if provided)
|
|
74
|
-
```
|
|
56
|
+
5. **Translation Keys**: When adding new text elements, always define translation keys in the i18n configuration files.
|
|
75
57
|
|
|
76
|
-
|
|
58
|
+
6. **Ordering**: Maintain consistent ordering of sections. About should precede Legal for better user experience.
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
7. **Documentation**: Update the domain component README files (About, Legal) when making changes to their interfaces.
|
|
79
61
|
|
|
80
|
-
|
|
81
|
-
function FullIdentitySettings() {
|
|
82
|
-
const normalizedConfig = {
|
|
83
|
-
about: {
|
|
84
|
-
config: {
|
|
85
|
-
appName: 'My App',
|
|
86
|
-
version: '1.0.0',
|
|
87
|
-
developer: 'My Company',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
legal: {
|
|
91
|
-
config: {
|
|
92
|
-
privacyPolicyUrl: 'https://example.com/privacy',
|
|
93
|
-
termsOfServiceUrl: 'https://example.com/terms',
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
};
|
|
62
|
+
8. **Testing**: Test both enabled and disabled states for each feature flag combination.
|
|
97
63
|
|
|
98
|
-
|
|
99
|
-
about: true,
|
|
100
|
-
legal: true,
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<IdentitySettingsSection
|
|
105
|
-
normalizedConfig={normalizedConfig}
|
|
106
|
-
features={features}
|
|
107
|
-
/>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### About Only
|
|
113
|
-
|
|
114
|
-
```tsx
|
|
115
|
-
function AboutOnlySettings() {
|
|
116
|
-
const normalizedConfig = {
|
|
117
|
-
about: {
|
|
118
|
-
config: {
|
|
119
|
-
appName: 'My App',
|
|
120
|
-
version: '1.0.0',
|
|
121
|
-
showDeveloper: true,
|
|
122
|
-
showContact: true,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const features = {
|
|
128
|
-
about: true,
|
|
129
|
-
legal: false,
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
return (
|
|
133
|
-
<IdentitySettingsSection
|
|
134
|
-
normalizedConfig={normalizedConfig}
|
|
135
|
-
features={features}
|
|
136
|
-
/>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Legal Only
|
|
142
|
-
|
|
143
|
-
```tsx
|
|
144
|
-
function LegalOnlySettings() {
|
|
145
|
-
const normalizedConfig = {
|
|
146
|
-
legal: {
|
|
147
|
-
config: {
|
|
148
|
-
showPrivacy: true,
|
|
149
|
-
showTerms: true,
|
|
150
|
-
showEula: false,
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const features = {
|
|
156
|
-
about: false,
|
|
157
|
-
legal: true,
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
return (
|
|
161
|
-
<IdentitySettingsSection
|
|
162
|
-
normalizedConfig={normalizedConfig}
|
|
163
|
-
features={features}
|
|
164
|
-
/>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### With Custom Configuration
|
|
170
|
-
|
|
171
|
-
```tsx
|
|
172
|
-
function CustomIdentitySettings() {
|
|
173
|
-
const normalizedConfig = {
|
|
174
|
-
about: {
|
|
175
|
-
config: {
|
|
176
|
-
appName: 'Custom App',
|
|
177
|
-
version: '2.0.0',
|
|
178
|
-
developer: 'Custom Developer',
|
|
179
|
-
websiteUrl: 'https://custom.com',
|
|
180
|
-
supportEmail: 'support@custom.com',
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
legal: {
|
|
184
|
-
config: {
|
|
185
|
-
privacyPolicyContent: 'Our privacy policy...',
|
|
186
|
-
termsOfServiceContent: 'Our terms...',
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
return (
|
|
192
|
-
<IdentitySettingsSection
|
|
193
|
-
normalizedConfig={normalizedConfig}
|
|
194
|
-
features={{ about: true, legal: true }}
|
|
195
|
-
/>
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Sub-Components
|
|
201
|
-
|
|
202
|
-
### AboutSection
|
|
203
|
-
|
|
204
|
-
From About domain, displays app information.
|
|
205
|
-
|
|
206
|
-
```tsx
|
|
207
|
-
<AboutSection
|
|
208
|
-
config={{
|
|
209
|
-
appName: 'My App',
|
|
210
|
-
version: '1.0.0',
|
|
211
|
-
developer: 'My Company',
|
|
212
|
-
contactEmail: 'support@example.com',
|
|
213
|
-
websiteUrl: 'https://example.com',
|
|
214
|
-
}}
|
|
215
|
-
sectionTitle="ABOUT"
|
|
216
|
-
/>
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
**AboutSection Props:**
|
|
220
|
-
|
|
221
|
-
- `appName`: Application name
|
|
222
|
-
- `version`: App version
|
|
223
|
-
- `buildNumber`: Build number
|
|
224
|
-
- `developer`: Developer/company name
|
|
225
|
-
- `contactEmail`: Support email
|
|
226
|
-
- `websiteUrl`: Website URL
|
|
227
|
-
- `actions`: Press handlers for email/website
|
|
228
|
-
|
|
229
|
-
### LegalSection
|
|
230
|
-
|
|
231
|
-
From Legal domain, displays legal document links.
|
|
232
|
-
|
|
233
|
-
```tsx
|
|
234
|
-
<LegalSection
|
|
235
|
-
config={{
|
|
236
|
-
title: 'Legal',
|
|
237
|
-
description: 'Important information',
|
|
238
|
-
privacyPolicyUrl: 'https://example.com/privacy',
|
|
239
|
-
termsOfServiceUrl: 'https://example.com/terms',
|
|
240
|
-
eulaUrl: 'https://example.com/eula',
|
|
241
|
-
}}
|
|
242
|
-
sectionTitle="LEGAL"
|
|
243
|
-
/>
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
**LegalSection Props:**
|
|
247
|
-
|
|
248
|
-
- `privacyPolicyUrl`: Privacy policy URL or content
|
|
249
|
-
- `termsOfServiceUrl`: Terms URL or content
|
|
250
|
-
- `eulaUrl`: EULA URL or content (optional)
|
|
251
|
-
- `onPrivacyPress`: Custom privacy handler
|
|
252
|
-
- `onTermsPress`: Custom terms handler
|
|
253
|
-
- `onEulaPress`: Custom EULA handler
|
|
254
|
-
|
|
255
|
-
## Configuration
|
|
256
|
-
|
|
257
|
-
### About Configuration
|
|
258
|
-
|
|
259
|
-
```typescript
|
|
260
|
-
interface AboutConfig {
|
|
261
|
-
appName?: string;
|
|
262
|
-
version?: string;
|
|
263
|
-
buildNumber?: string;
|
|
264
|
-
developer?: string;
|
|
265
|
-
contactEmail?: string;
|
|
266
|
-
websiteUrl?: string;
|
|
267
|
-
websiteDisplay?: string;
|
|
268
|
-
moreAppsUrl?: string;
|
|
269
|
-
actions?: {
|
|
270
|
-
onEmailPress?: () => void;
|
|
271
|
-
onWebsitePress?: () => void;
|
|
272
|
-
onMoreAppsPress?: () => void;
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Legal Configuration
|
|
278
|
-
|
|
279
|
-
```typescript
|
|
280
|
-
interface LegalConfig {
|
|
281
|
-
privacyPolicyUrl?: string;
|
|
282
|
-
termsOfServiceUrl?: string;
|
|
283
|
-
eulaUrl?: string;
|
|
284
|
-
privacyPolicyContent?: string;
|
|
285
|
-
termsOfServiceContent?: string;
|
|
286
|
-
eulaContent?: string;
|
|
287
|
-
onPrivacyPress?: () => void;
|
|
288
|
-
onTermsPress?: () => void;
|
|
289
|
-
onEulaPress?: () => void;
|
|
290
|
-
}
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## Internationalization
|
|
294
|
-
|
|
295
|
-
Translation keys used:
|
|
296
|
-
|
|
297
|
-
```typescript
|
|
298
|
-
// About
|
|
299
|
-
t("settings.about.title")
|
|
300
|
-
t("settings.about.description")
|
|
301
|
-
|
|
302
|
-
// Legal
|
|
303
|
-
t("settings.legal.title")
|
|
304
|
-
t("settings.legal.description")
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
## Best Practices
|
|
308
|
-
|
|
309
|
-
1. **Separate Concerns**: Keep identity settings separate from other features
|
|
310
|
-
2. **Consistent Order**: About first, then Legal
|
|
311
|
-
3. **Navigation**: Provide proper navigation handlers
|
|
312
|
-
4. **URL Handling**: Handle both URLs and inline content
|
|
313
|
-
5. **Translation**: Use translation keys for all text
|
|
314
|
-
6. **Contact Info**: Always include contact information in About
|
|
315
|
-
7. **Legal Docs**: Include all required legal documents
|
|
316
|
-
|
|
317
|
-
## Related
|
|
64
|
+
## Related Components
|
|
318
65
|
|
|
319
66
|
- **About Domain**: App information features
|
|
320
67
|
- **Legal Domain**: Legal document features
|
|
321
68
|
- **Feature Settings**: Other setting sections
|
|
322
|
-
|
|
323
|
-
## License
|
|
324
|
-
|
|
325
|
-
MIT
|