@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
package/README.md
CHANGED
|
@@ -2,27 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Comprehensive settings management for React Native apps with modular domain-based architecture.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- β
**Setting Components** - Reusable setting item components
|
|
13
|
-
- β
**Type-Safe** - Full TypeScript support
|
|
14
|
-
|
|
15
|
-
### Domain Features
|
|
16
|
-
- π¨ **Appearance** - Theme customization (light/dark mode), custom color schemes
|
|
17
|
-
- βΉοΈ **About** - App information, version details, developer contact
|
|
18
|
-
- βοΈ **Legal** - Privacy policy, terms of service, legal documents
|
|
19
|
-
- β οΈ **Disclaimer** - Legal notices, warnings, important information
|
|
20
|
-
- π¬ **Feedback** - User feedback forms, support resources
|
|
21
|
-
- β **FAQs** - Searchable frequently asked questions
|
|
22
|
-
- β **Rating** - Star rating system with statistics
|
|
23
|
-
- π₯ **Video Tutorials** - Tutorial browser with featured content
|
|
24
|
-
- βοΈ **Cloud Sync** - Sync status and management
|
|
25
|
-
- π οΈ **Dev Tools** - Development utilities (DEV mode only)
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Complete settings solution with pre-built screens, components, and state management for React Native applications.
|
|
8
|
+
|
|
9
|
+
## File Path
|
|
10
|
+
|
|
11
|
+
Main package entry: `src/index.ts`
|
|
26
12
|
|
|
27
13
|
## Installation
|
|
28
14
|
|
|
@@ -32,501 +18,338 @@ npm install @umituz/react-native-settings
|
|
|
32
18
|
|
|
33
19
|
## Peer Dependencies
|
|
34
20
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
###
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
- `
|
|
220
|
-
- `
|
|
221
|
-
- `
|
|
222
|
-
- `
|
|
223
|
-
- `
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
21
|
+
Required packages (check package.json for versions):
|
|
22
|
+
- zustand
|
|
23
|
+
- @umituz/react-native-storage
|
|
24
|
+
- @umituz/react-native-design-system
|
|
25
|
+
- @umituz/react-native-localization
|
|
26
|
+
- @react-navigation/native
|
|
27
|
+
- @react-navigation/stack
|
|
28
|
+
- react-native-safe-area-context
|
|
29
|
+
|
|
30
|
+
## Strategy
|
|
31
|
+
|
|
32
|
+
### Package Architecture
|
|
33
|
+
|
|
34
|
+
The package follows Domain-Driven Design (DDD) with four layers:
|
|
35
|
+
|
|
36
|
+
1. **Domain Layer**: Business logic and entities
|
|
37
|
+
2. **Application Layer**: Interfaces and orchestration
|
|
38
|
+
3. **Infrastructure Layer**: Data persistence
|
|
39
|
+
4. **Presentation Layer**: UI components and screens
|
|
40
|
+
|
|
41
|
+
### Integration Approach
|
|
42
|
+
|
|
43
|
+
1. Import components from `@umituz/react-native-settings`
|
|
44
|
+
2. Use pre-built screens for standard settings
|
|
45
|
+
3. Customize via configuration objects
|
|
46
|
+
4. Extend with custom sections when needed
|
|
47
|
+
5. Follow design system for consistency
|
|
48
|
+
|
|
49
|
+
### Domain Structure
|
|
50
|
+
|
|
51
|
+
Each feature domain is self-contained:
|
|
52
|
+
- `about/`: App information and version
|
|
53
|
+
- `appearance/`: Theme and color management
|
|
54
|
+
- `legal/`: Legal documents and policies
|
|
55
|
+
- `disclaimer/`: Legal notices and warnings
|
|
56
|
+
- `feedback/`: User feedback collection
|
|
57
|
+
- `faqs/`: FAQ management
|
|
58
|
+
- `rating/`: Rating system
|
|
59
|
+
- `video-tutorials/`: Video tutorials
|
|
60
|
+
- `cloud-sync/`: Cloud synchronization
|
|
61
|
+
- `dev/`: Development utilities
|
|
62
|
+
|
|
63
|
+
## Restrictions (Forbidden)
|
|
64
|
+
|
|
65
|
+
### β DO NOT
|
|
66
|
+
|
|
67
|
+
- Create custom settings screens from scratch
|
|
68
|
+
- Duplicate existing component functionality
|
|
69
|
+
- Mix settings logic with business logic
|
|
70
|
+
- Hardcode feature availability
|
|
71
|
+
- Bypass feature detection system
|
|
72
|
+
- Access storage repositories directly from UI
|
|
73
|
+
- Create custom settings item components
|
|
74
|
+
- Ignore design system tokens
|
|
75
|
+
- Mix UI and data layers inappropriately
|
|
76
|
+
|
|
77
|
+
### β NEVER
|
|
78
|
+
|
|
79
|
+
- Modify internal package files
|
|
80
|
+
- Override core component behavior
|
|
81
|
+
- Skip type checking
|
|
82
|
+
- Use deprecated APIs
|
|
83
|
+
- Ignore accessibility requirements
|
|
84
|
+
- Bypass error boundaries
|
|
85
|
+
- Hardcode colors or spacing
|
|
86
|
+
- Create circular dependencies between layers
|
|
87
|
+
|
|
88
|
+
### β AVOID
|
|
89
|
+
|
|
90
|
+
- Over-complicating configuration
|
|
91
|
+
- Creating one-off solutions
|
|
92
|
+
- Inconsistent styling
|
|
93
|
+
- Skipping proper error handling
|
|
94
|
+
- Not testing on both platforms
|
|
95
|
+
- Ignoring performance optimization
|
|
96
|
+
- Bypassing TypeScript strict mode
|
|
97
|
+
|
|
98
|
+
## Rules
|
|
99
|
+
|
|
100
|
+
### β
ALWAYS
|
|
101
|
+
|
|
102
|
+
- Use TypeScript strict mode
|
|
103
|
+
- Import from package exports
|
|
104
|
+
- Follow component documentation strategies
|
|
105
|
+
- Reference implementation files for current patterns
|
|
106
|
+
- Use design system tokens for styling
|
|
107
|
+
- Handle errors gracefully
|
|
108
|
+
- Support both iOS and Android
|
|
109
|
+
- Include proper accessibility labels
|
|
110
|
+
- Test with feature flags
|
|
111
|
+
- Follow DDD layer separation
|
|
112
|
+
|
|
113
|
+
### β
MUST
|
|
114
|
+
|
|
115
|
+
- Use SettingsScreen for main settings UI
|
|
116
|
+
- Use SettingsItemCard for all settings items
|
|
117
|
+
- Normalize configuration before use
|
|
118
|
+
- Handle loading and error states
|
|
119
|
+
- Provide proper TypeScript types
|
|
120
|
+
- Export types for reuse
|
|
121
|
+
- Follow naming conventions
|
|
122
|
+
- Document custom components
|
|
123
|
+
- Test all new features
|
|
124
|
+
- Maintain backward compatibility
|
|
125
|
+
|
|
126
|
+
### β
SHOULD
|
|
127
|
+
|
|
128
|
+
- Use auto-detection for features
|
|
129
|
+
- Group related settings together
|
|
130
|
+
- Provide meaningful section titles
|
|
131
|
+
- Support both modal and push navigation
|
|
132
|
+
- Include user profile for authenticated users
|
|
133
|
+
- Add custom sections via config
|
|
134
|
+
- Use feature flags appropriately
|
|
135
|
+
- Optimize performance with memoization
|
|
136
|
+
- Follow AI agent guidelines
|
|
137
|
+
- Keep documentation up to date
|
|
138
|
+
|
|
139
|
+
## Component Reference
|
|
140
|
+
|
|
141
|
+
### Main Components
|
|
142
|
+
|
|
143
|
+
File: `src/index.ts`
|
|
144
|
+
|
|
145
|
+
**Screens:**
|
|
146
|
+
- `SettingsScreen`: Main settings screen
|
|
147
|
+
- Implementation: `src/presentation/screens/SettingsScreen.tsx`
|
|
148
|
+
- Documentation: `SETTINGS_SCREEN_GUIDE.md`
|
|
149
|
+
|
|
150
|
+
**Components:**
|
|
151
|
+
- `SettingsItemCard`: Reusable settings item
|
|
152
|
+
- Implementation: `src/presentation/components/SettingsItemCard/SettingsItemCard.tsx`
|
|
153
|
+
- Strategy: `src/presentation/components/SettingsItemCard/STRATEGY.md`
|
|
154
|
+
|
|
155
|
+
- `SettingsSection`: Section container
|
|
156
|
+
- Implementation: `src/presentation/components/SettingsSection/SettingsSection.tsx`
|
|
157
|
+
|
|
158
|
+
- `SettingsContent`: Content composer
|
|
159
|
+
- Implementation: `src/presentation/screens/components/SettingsContent/SettingsContent.tsx`
|
|
160
|
+
|
|
161
|
+
**Hooks:**
|
|
162
|
+
- `useSettings`: Main settings hook
|
|
163
|
+
- Implementation: `src/presentation/hooks/useSettings.ts`
|
|
164
|
+
|
|
165
|
+
- `useFeatureDetection`: Feature detection
|
|
166
|
+
- Implementation: `src/presentation/screens/hooks/useFeatureDetection.ts`
|
|
167
|
+
|
|
168
|
+
### Domain Components
|
|
169
|
+
|
|
170
|
+
Each domain has its own components:
|
|
171
|
+
|
|
172
|
+
**Appearance:**
|
|
173
|
+
- Screen: `src/domains/appearance/presentation/screens/AppearanceScreen.tsx`
|
|
174
|
+
- Components: `src/domains/appearance/presentation/components/`
|
|
175
|
+
- Hooks: `src/domains/appearance/hooks/`
|
|
176
|
+
|
|
177
|
+
**About:**
|
|
178
|
+
- Screen: `src/domains/about/presentation/screens/AboutScreen.tsx`
|
|
179
|
+
- Components: `src/domains/about/presentation/components/`
|
|
180
|
+
- Hooks: `src/domains/about/presentation/hooks/`
|
|
181
|
+
|
|
182
|
+
**Other Domains:**
|
|
183
|
+
- Legal: `src/domains/legal/`
|
|
184
|
+
- Disclaimer: `src/domains/disclaimer/`
|
|
185
|
+
- Feedback: `src/domains/feedback/`
|
|
186
|
+
- FAQs: `src/domains/faqs/`
|
|
187
|
+
- Rating: `src/domains/rating/`
|
|
188
|
+
- Video Tutorials: `src/domains/video-tutorials/`
|
|
189
|
+
- Cloud Sync: `src/domains/cloud-sync/`
|
|
190
|
+
- Dev: `src/domains/dev/`
|
|
191
|
+
|
|
192
|
+
## Configuration
|
|
193
|
+
|
|
194
|
+
### Settings Configuration
|
|
195
|
+
|
|
196
|
+
Type definition: `src/presentation/screens/types/SettingsConfig.ts`
|
|
197
|
+
|
|
198
|
+
Configuration structure:
|
|
199
|
+
- `appearance`: Theme settings
|
|
200
|
+
- `language`: Language selection
|
|
201
|
+
- `notifications`: Notification preferences
|
|
202
|
+
- `about`: App information
|
|
203
|
+
- `legal`: Legal documents
|
|
204
|
+
- `disclaimer`: Legal notices
|
|
205
|
+
- `userProfile`: User profile display
|
|
206
|
+
- `feedback`: Feedback system
|
|
207
|
+
- `rating`: Rating feature
|
|
208
|
+
- `faqs`: FAQ access
|
|
209
|
+
- `subscription`: Subscription/upgrade
|
|
210
|
+
- `wallet`: Wallet/payment
|
|
211
|
+
- `customSections`: App-specific sections
|
|
212
|
+
|
|
213
|
+
### Feature Flags
|
|
214
|
+
|
|
215
|
+
Use feature flags to control visibility:
|
|
216
|
+
- `true`: Always show feature
|
|
217
|
+
- `false`: Never show feature
|
|
218
|
+
- `'auto'`: Auto-detect based on navigation
|
|
219
|
+
|
|
220
|
+
## AI Agent Guidelines
|
|
221
|
+
|
|
222
|
+
### When Implementing Settings
|
|
223
|
+
|
|
224
|
+
1. **Read Strategy Documentation First**
|
|
225
|
+
- Check `STRATEGY.md` files in component directories
|
|
226
|
+
- Review `AI_AGENT_GUIDELINES.md`
|
|
227
|
+
- Understand restrictions and rules
|
|
228
|
+
|
|
229
|
+
2. **Reference Implementation Files**
|
|
230
|
+
- Check file paths in documentation
|
|
231
|
+
- Look at similar existing implementations
|
|
232
|
+
- Follow established patterns
|
|
233
|
+
|
|
234
|
+
3. **No Code Examples**
|
|
235
|
+
- Documentation contains strategy, not syntax
|
|
236
|
+
- Reference implementation files directly
|
|
237
|
+
- File paths stay valid when code changes
|
|
232
238
|
|
|
233
|
-
|
|
239
|
+
4. **Follow Component Structure**
|
|
240
|
+
- Use existing components from package
|
|
241
|
+
- Don't recreate what already exists
|
|
242
|
+
- Extend via configuration, not modification
|
|
243
|
+
|
|
244
|
+
5. **Check Restrictions Before Coding**
|
|
245
|
+
- Review what's forbidden
|
|
246
|
+
- Verify rules to follow
|
|
247
|
+
- Ask if unclear
|
|
248
|
+
|
|
249
|
+
### Common Patterns
|
|
250
|
+
|
|
251
|
+
**Adding Settings Screen:**
|
|
252
|
+
Reference: `SETTINGS_SCREEN_GUIDE.md`
|
|
253
|
+
- Use SettingsScreen component
|
|
254
|
+
- Configure via SettingsConfig
|
|
255
|
+
- Don't build from scratch
|
|
256
|
+
|
|
257
|
+
**Adding Settings Item:**
|
|
258
|
+
Reference: `src/presentation/components/SettingsItemCard/STRATEGY.md`
|
|
259
|
+
- Use SettingsItemCard component
|
|
260
|
+
- Follow props interface
|
|
261
|
+
- Don't create custom items
|
|
262
|
+
|
|
263
|
+
**Adding Domain Feature:**
|
|
264
|
+
Reference: Similar domain README
|
|
265
|
+
- Follow domain structure
|
|
266
|
+
- Implement required layers
|
|
267
|
+
- Document with strategy format
|
|
268
|
+
|
|
269
|
+
## Documentation Structure
|
|
270
|
+
|
|
271
|
+
### Key Documentation Files
|
|
272
|
+
|
|
273
|
+
- `README.md`: This file - package overview
|
|
274
|
+
- `DOCUMENTATION_TEMPLATE.md`: Template for new docs
|
|
275
|
+
- `AI_AGENT_GUIDELINES.md`: AI coding guidelines
|
|
276
|
+
- `SETTINGS_SCREEN_GUIDE.md`: Screen strategy
|
|
277
|
+
- `ARCHITECTURE.md`: Architecture overview
|
|
278
|
+
- `TESTING.md`: Testing guide
|
|
279
|
+
|
|
280
|
+
### Domain Documentation
|
|
281
|
+
|
|
282
|
+
Each domain has README.md with:
|
|
283
|
+
- Purpose and file paths
|
|
284
|
+
- Strategy for usage
|
|
285
|
+
- Restrictions (what not to do)
|
|
286
|
+
- Rules (what must be done)
|
|
287
|
+
- Component references
|
|
288
|
+
- AI agent guidelines
|
|
289
|
+
|
|
290
|
+
### Component Documentation
|
|
234
291
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
- `switchValue?: boolean` - Switch value
|
|
244
|
-
- `onSwitchChange?: (value: boolean) => void` - Switch change handler
|
|
245
|
-
- `iconColor?: string` - Custom icon color
|
|
246
|
-
- `iconBgColor?: string` - Custom icon background color
|
|
247
|
-
- `rightIcon?: IconName` - Custom right icon (defaults to chevron-forward)
|
|
248
|
-
- `disabled?: boolean` - Disable the item
|
|
249
|
-
|
|
250
|
-
### `SettingsSection`
|
|
251
|
-
|
|
252
|
-
Section container with title and styled content area.
|
|
253
|
-
|
|
254
|
-
**Props:**
|
|
255
|
-
- `title: string` - Section title (uppercase)
|
|
256
|
-
- `children: React.ReactNode` - Section content
|
|
257
|
-
|
|
258
|
-
### `UserProfileHeader`
|
|
259
|
-
|
|
260
|
-
User profile header with avatar, name, and ID.
|
|
261
|
-
|
|
262
|
-
**Props:**
|
|
263
|
-
- `displayName?: string` - User display name
|
|
264
|
-
- `userId?: string` - User ID
|
|
265
|
-
- `isGuest?: boolean` - Whether user is guest
|
|
266
|
-
- `avatarUrl?: string` - Custom avatar URL
|
|
267
|
-
- `accountSettingsRoute?: string` - Navigation route for account settings
|
|
268
|
-
- `onPress?: () => void` - Custom onPress handler
|
|
269
|
-
|
|
270
|
-
### `SettingsFooter`
|
|
271
|
-
|
|
272
|
-
Footer component displaying app version.
|
|
273
|
-
|
|
274
|
-
**Props:**
|
|
275
|
-
- `versionText?: string` - Custom version text (optional)
|
|
276
|
-
|
|
277
|
-
### `DisclaimerSetting`
|
|
278
|
-
|
|
279
|
-
Disclaimer component with modal display for legal notices.
|
|
280
|
-
|
|
281
|
-
**Props:**
|
|
282
|
-
- `titleKey?: string` - Translation key for title (default: "settings.disclaimer.title")
|
|
283
|
-
- `messageKey?: string` - Translation key for message (default: "settings.disclaimer.message")
|
|
284
|
-
- `shortMessageKey?: string` - Translation key for short message (default: "settings.disclaimer.shortMessage")
|
|
285
|
-
- `iconName?: string` - Icon name (default: "AlertTriangle")
|
|
286
|
-
- `iconColor?: string` - Custom icon color
|
|
287
|
-
- `backgroundColor?: string` - Custom background color
|
|
288
|
-
- `modalTitle?: string` - Custom modal title (overrides translation)
|
|
289
|
-
- `modalContent?: string` - Custom modal content (overrides translation)
|
|
290
|
-
|
|
291
|
-
### `CloudSyncSetting`
|
|
292
|
-
|
|
293
|
-
Cloud sync setting component with status display.
|
|
294
|
-
|
|
295
|
-
**Props:**
|
|
296
|
-
- `title?: string` - Custom title (default: "cloud_sync" translation key)
|
|
297
|
-
- `description?: string` - Custom description
|
|
298
|
-
- `isSyncing?: boolean` - Whether currently syncing
|
|
299
|
-
- `lastSynced?: Date | null` - Last sync time
|
|
300
|
-
- `onPress?: () => void` - Press handler
|
|
301
|
-
- `iconColor?: string` - Custom icon color
|
|
302
|
-
- `titleColor?: string` - Custom title color
|
|
303
|
-
|
|
304
|
-
### `DisclaimerCard`
|
|
305
|
-
|
|
306
|
-
Card component for disclaimer display (used internally by DisclaimerSetting).
|
|
307
|
-
|
|
308
|
-
### `DisclaimerModal`
|
|
309
|
-
|
|
310
|
-
Modal component for full disclaimer display (used internally by DisclaimerSetting).
|
|
311
|
-
|
|
312
|
-
### `SettingsErrorBoundary`
|
|
313
|
-
|
|
314
|
-
Error boundary component for settings screens.
|
|
315
|
-
|
|
316
|
-
**Props:**
|
|
317
|
-
- `children: ReactNode` - Child components
|
|
318
|
-
- `fallback?: ReactNode` - Custom fallback component
|
|
319
|
-
- `fallbackTitle?: string` - Custom error title translation key
|
|
320
|
-
- `fallbackMessage?: string` - Custom error message translation key
|
|
321
|
-
|
|
322
|
-
## Types
|
|
323
|
-
|
|
324
|
-
- `UserSettings` - User settings interface
|
|
325
|
-
- `SettingsError` - Settings error interface
|
|
326
|
-
- `SettingsResult<T>` - Result type for settings operations
|
|
327
|
-
- `ISettingsRepository` - Repository interface
|
|
328
|
-
|
|
329
|
-
## UserSettings Interface
|
|
292
|
+
Each component directory may contain:
|
|
293
|
+
- `README.md`: Component reference
|
|
294
|
+
- `STRATEGY.md`: Detailed strategy guide
|
|
295
|
+
- Implementation file with TypeScript types
|
|
296
|
+
|
|
297
|
+
## Quick Reference
|
|
298
|
+
|
|
299
|
+
### Import Patterns
|
|
330
300
|
|
|
331
301
|
```typescript
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
theme: 'light' | 'dark' | 'auto';
|
|
335
|
-
language: string;
|
|
336
|
-
notificationsEnabled: boolean;
|
|
337
|
-
emailNotifications: boolean;
|
|
338
|
-
pushNotifications: boolean;
|
|
339
|
-
soundEnabled: boolean;
|
|
340
|
-
vibrationEnabled: boolean;
|
|
341
|
-
privacyMode: boolean;
|
|
342
|
-
updatedAt: Date;
|
|
343
|
-
}
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
## Important Notes
|
|
302
|
+
// From package
|
|
303
|
+
import { ComponentName } from '@umituz/react-native-settings';
|
|
347
304
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
β οΈ **Navigation**: Settings screens require navigation setup. Make sure to add them to your navigation stack.
|
|
351
|
-
|
|
352
|
-
β οΈ **Translations**: Settings screens require i18n translations. Make sure to provide translations for settings keys.
|
|
353
|
-
|
|
354
|
-
β οΈ **Dynamic Text**: All text in this package uses translation keys to be app-agnostic. Provide translations like:
|
|
355
|
-
- `cloud_sync`, `syncing`, `sync_to_cloud`, `never_synced`, `just_now`, `Xm_ago`, `Xh_ago`, `Xd_ago`
|
|
356
|
-
- `error_boundary.title`, `error_boundary.message`, `error_boundary.dev_title`, `error_boundary.dev_message`
|
|
357
|
-
- `settings.disclaimer.title`, `settings.disclaimer.message`, `settings.disclaimer.shortMessage`
|
|
358
|
-
|
|
359
|
-
β οΈ **Design System**: Uses @umituz/react-native-design-system packages for consistent styling across apps.
|
|
360
|
-
|
|
361
|
-
β οΈ **Development Logs**: All console logs are wrapped in `__DEV__` checks for production safety.
|
|
362
|
-
|
|
363
|
-
## Architecture
|
|
364
|
-
|
|
365
|
-
This package follows **Domain-Driven Design (DDD)** principles:
|
|
366
|
-
|
|
367
|
-
- **Domain Layer**: Repository interfaces and business entities
|
|
368
|
-
- **Infrastructure Layer**: Storage implementation with Zustand
|
|
369
|
-
- **Presentation Layer**: UI components and screens
|
|
370
|
-
|
|
371
|
-
### Key Principles
|
|
372
|
-
|
|
373
|
-
β
**SOLID**: Single responsibility, open/closed, Liskov substitution, interface segregation, dependency inversion
|
|
374
|
-
β
**DRY**: No code duplication, reusable components
|
|
375
|
-
β
**KISS**: Simple, maintainable code
|
|
376
|
-
β
**200-line limit**: All files under 200 lines for maintainability
|
|
377
|
-
β
**TypeScript**: Full type safety
|
|
378
|
-
β
**Memory Leak Prevention**: Proper cleanup and error handling
|
|
379
|
-
β
**App-Agnostic**: No hardcoded app-specific text or logic
|
|
380
|
-
β
**Test Coverage**: Comprehensive test suite
|
|
381
|
-
|
|
382
|
-
## Performance
|
|
383
|
-
|
|
384
|
-
- β
**Optimized Rendering**: React.memo and useMemo where appropriate
|
|
385
|
-
- β
**Memory Management**: Proper cleanup in useEffect hooks
|
|
386
|
-
- β
**Error Boundaries**: Prevent crashes and provide graceful fallbacks
|
|
387
|
-
- β
**Development Logs**: __DEV__ only logging for production safety
|
|
388
|
-
|
|
389
|
-
## Domain Documentation
|
|
390
|
-
|
|
391
|
-
Each domain has comprehensive documentation with usage examples, API references, and best practices:
|
|
392
|
-
|
|
393
|
-
- **[About Domain Documentation](./src/domains/about/README.md)** - App information, version details, contact information
|
|
394
|
-
- **[Appearance Domain Documentation](./src/domains/appearance/README.md)** - Theme management, dark mode, custom colors
|
|
395
|
-
- **[Legal Domain Documentation](./src/domains/legal/README.md)** - Privacy policy, terms of service, legal documents
|
|
396
|
-
- **[Disclaimer Domain Documentation](./src/domains/disclaimer/README.md)** - Legal notices, warnings, important information
|
|
397
|
-
- **[Feedback Domain Documentation](./src/domains/feedback/README.md)** - Feedback forms, support resources
|
|
398
|
-
- **[FAQs Domain Documentation](./src/domains/faqs/README.md)** - Searchable FAQ system
|
|
399
|
-
- **[Rating Domain Documentation](./src/domains/rating/README.md)** - Star rating component
|
|
400
|
-
- **[Video Tutorials Domain Documentation](./src/domains/video-tutorials/README.md)** - Video tutorial browser
|
|
401
|
-
- **[Cloud Sync Domain Documentation](./src/domains/cloud-sync/README.md)** - Cloud sync status and management
|
|
402
|
-
- **[Dev Domain Documentation](./src/domains/dev/README.md)** - Development utilities (DEV mode only)
|
|
403
|
-
|
|
404
|
-
## Quick Start Examples
|
|
405
|
-
|
|
406
|
-
### Complete Settings App
|
|
407
|
-
|
|
408
|
-
```tsx
|
|
409
|
-
import React from 'react';
|
|
410
|
-
import { NavigationContainer } from '@react-navigation/native';
|
|
411
|
-
import { createStackNavigator } from '@react-navigation/stack';
|
|
412
|
-
import {
|
|
413
|
-
SettingsScreen,
|
|
414
|
-
AppearanceScreen,
|
|
415
|
-
AboutScreen,
|
|
416
|
-
LegalScreen,
|
|
417
|
-
FAQScreen,
|
|
418
|
-
} from '@umituz/react-native-settings';
|
|
419
|
-
|
|
420
|
-
const Stack = createStackNavigator();
|
|
421
|
-
|
|
422
|
-
function App() {
|
|
423
|
-
return (
|
|
424
|
-
<NavigationContainer>
|
|
425
|
-
<Stack.Navigator>
|
|
426
|
-
<Stack.Screen name="Settings" component={SettingsScreen} />
|
|
427
|
-
<Stack.Screen name="Appearance" component={AppearanceScreen} />
|
|
428
|
-
<Stack.Screen name="About" component={AboutScreen} />
|
|
429
|
-
<Stack.Screen name="Legal" component={LegalScreen} />
|
|
430
|
-
<Stack.Screen name="FAQ" component={FAQScreen} />
|
|
431
|
-
</Stack.Navigator>
|
|
432
|
-
</NavigationContainer>
|
|
433
|
-
);
|
|
434
|
-
}
|
|
305
|
+
// Types
|
|
306
|
+
import type { SettingsConfig, UserProfile } from '@umituz/react-native-settings';
|
|
435
307
|
```
|
|
436
308
|
|
|
437
|
-
###
|
|
438
|
-
|
|
439
|
-
```tsx
|
|
440
|
-
import { SettingsSection, SettingsItemCard } from '@umituz/react-native-settings';
|
|
441
|
-
|
|
442
|
-
function CustomSettingsScreen() {
|
|
443
|
-
return (
|
|
444
|
-
<ScreenLayout>
|
|
445
|
-
<SettingsSection title="PREFERENCES">
|
|
446
|
-
<SettingsItemCard
|
|
447
|
-
icon="moon-outline"
|
|
448
|
-
title="Dark Mode"
|
|
449
|
-
showSwitch={true}
|
|
450
|
-
switchValue={isDarkMode}
|
|
451
|
-
onSwitchChange={setDarkMode}
|
|
452
|
-
/>
|
|
453
|
-
<SettingsItemCard
|
|
454
|
-
icon="globe-outline"
|
|
455
|
-
title="Language"
|
|
456
|
-
description="English"
|
|
457
|
-
onPress={() => {}}
|
|
458
|
-
/>
|
|
459
|
-
</SettingsSection>
|
|
460
|
-
|
|
461
|
-
<SettingsSection title="SUPPORT">
|
|
462
|
-
<SettingsItemCard
|
|
463
|
-
icon="help-circle-outline"
|
|
464
|
-
title="Help & FAQs"
|
|
465
|
-
onPress={() => navigation.navigate('FAQ')}
|
|
466
|
-
/>
|
|
467
|
-
<SettingsItemCard
|
|
468
|
-
icon="chatbubble-outline"
|
|
469
|
-
title="Send Feedback"
|
|
470
|
-
onPress={() => navigation.navigate('Feedback')}
|
|
471
|
-
/>
|
|
472
|
-
</SettingsSection>
|
|
473
|
-
</ScreenLayout>
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
## Project Structure
|
|
309
|
+
### File Locations
|
|
479
310
|
|
|
480
311
|
```
|
|
481
312
|
src/
|
|
482
|
-
βββ domains/
|
|
483
|
-
β βββ about/
|
|
484
|
-
β βββ appearance/
|
|
485
|
-
β βββ legal/
|
|
486
|
-
β
|
|
487
|
-
|
|
488
|
-
β βββ
|
|
489
|
-
β βββ
|
|
490
|
-
β βββ
|
|
491
|
-
β
|
|
492
|
-
|
|
493
|
-
βββ
|
|
494
|
-
|
|
495
|
-
β βββ components/ # Reusable components
|
|
496
|
-
β βββ hooks/ # Shared hooks
|
|
497
|
-
βββ application/ # Application logic
|
|
498
|
-
βββ infrastructure/ # External dependencies
|
|
499
|
-
βββ index.ts # Main exports
|
|
313
|
+
βββ domains/ # Feature domains
|
|
314
|
+
β βββ about/
|
|
315
|
+
β βββ appearance/
|
|
316
|
+
β βββ legal/
|
|
317
|
+
β βββ ...
|
|
318
|
+
βββ presentation/ # UI layer
|
|
319
|
+
β βββ components/ # Shared components
|
|
320
|
+
β βββ screens/ # Screens
|
|
321
|
+
β βββ hooks/ # Hooks
|
|
322
|
+
β βββ navigation/ # Navigation
|
|
323
|
+
βββ application/ # Interfaces
|
|
324
|
+
βββ infrastructure/ # Data layer
|
|
325
|
+
βββ index.ts # Package exports
|
|
500
326
|
```
|
|
501
327
|
|
|
502
|
-
##
|
|
328
|
+
## Related Documentation
|
|
503
329
|
|
|
504
|
-
|
|
505
|
-
- **
|
|
506
|
-
- **
|
|
507
|
-
- **
|
|
508
|
-
- **
|
|
509
|
-
- **
|
|
510
|
-
- **
|
|
330
|
+
### Core Documentation
|
|
331
|
+
- **Architecture**: `ARCHITECTURE.md`
|
|
332
|
+
- **Testing**: `TESTING.md`
|
|
333
|
+
- **AI Guidelines**: `AI_AGENT_GUIDELINES.md`
|
|
334
|
+
- **Settings Screen**: `SETTINGS_SCREEN_GUIDE.md`
|
|
335
|
+
- **Documentation Template**: `DOCUMENTATION_TEMPLATE.md`
|
|
336
|
+
- **Migration**: `DOCUMENTATION_MIGRATION.md`
|
|
511
337
|
|
|
512
|
-
|
|
338
|
+
### Community
|
|
339
|
+
- **Contributing**: `CONTRIBUTING.md`
|
|
340
|
+
- **Code of Conduct**: `CODE_OF_CONDUCT.md`
|
|
341
|
+
- **Security**: `SECURITY.md`
|
|
342
|
+
- **Changelog**: `CHANGELOG.md`
|
|
513
343
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
4. Update relevant domain README
|
|
519
|
-
5. Follow TypeScript best practices
|
|
344
|
+
### Component Documentation
|
|
345
|
+
- **Domain READMEs**: Check individual domain directories
|
|
346
|
+
- **Component Strategies**: Check component STRATEGY.md files
|
|
347
|
+
- **Component READMEs**: Check component directories
|
|
520
348
|
|
|
521
349
|
## License
|
|
522
350
|
|
|
523
351
|
MIT
|
|
524
352
|
|
|
525
|
-
##
|
|
526
|
-
|
|
527
|
-
Γmit UZ <umit@umituz.com>
|
|
528
|
-
|
|
529
|
-
---
|
|
530
|
-
|
|
531
|
-
**Made with β€οΈ for the React Native community**
|
|
353
|
+
## Version History
|
|
532
354
|
|
|
355
|
+
See package.json for version information.
|