@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.
Files changed (64) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +51 -0
  2. package/.github/ISSUE_TEMPLATE/documentation.md +52 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +63 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +84 -0
  5. package/AI_AGENT_GUIDELINES.md +367 -0
  6. package/ARCHITECTURE.md +246 -0
  7. package/CHANGELOG.md +67 -0
  8. package/CODE_OF_CONDUCT.md +75 -0
  9. package/CONTRIBUTING.md +107 -0
  10. package/DOCUMENTATION_MIGRATION.md +319 -0
  11. package/DOCUMENTATION_TEMPLATE.md +155 -0
  12. package/LICENSE +21 -0
  13. package/README.md +321 -498
  14. package/SECURITY.md +98 -0
  15. package/SETTINGS_SCREEN_GUIDE.md +185 -0
  16. package/TESTING.md +358 -0
  17. package/package.json +13 -2
  18. package/src/application/README.md +85 -271
  19. package/src/domains/about/README.md +85 -440
  20. package/src/domains/about/presentation/hooks/README.md +93 -348
  21. package/src/domains/appearance/README.md +95 -584
  22. package/src/domains/appearance/hooks/README.md +95 -303
  23. package/src/domains/appearance/infrastructure/services/README.md +83 -397
  24. package/src/domains/appearance/presentation/components/README.md +95 -489
  25. package/src/domains/cloud-sync/README.md +73 -439
  26. package/src/domains/cloud-sync/presentation/components/README.md +95 -493
  27. package/src/domains/dev/README.md +71 -457
  28. package/src/domains/disclaimer/README.md +77 -411
  29. package/src/domains/disclaimer/presentation/components/README.md +95 -392
  30. package/src/domains/faqs/README.md +86 -574
  31. package/src/domains/feedback/README.md +79 -553
  32. package/src/domains/feedback/presentation/hooks/README.md +93 -426
  33. package/src/domains/legal/README.md +88 -537
  34. package/src/domains/rating/README.md +73 -440
  35. package/src/domains/rating/presentation/components/README.md +95 -475
  36. package/src/domains/video-tutorials/README.md +77 -470
  37. package/src/domains/video-tutorials/presentation/components/README.md +95 -431
  38. package/src/infrastructure/README.md +78 -425
  39. package/src/infrastructure/repositories/README.md +88 -420
  40. package/src/infrastructure/services/README.md +74 -460
  41. package/src/presentation/components/README.md +97 -480
  42. package/src/presentation/components/SettingsErrorBoundary/README.md +48 -436
  43. package/src/presentation/components/SettingsFooter/README.md +48 -427
  44. package/src/presentation/components/SettingsItemCard/README.md +152 -391
  45. package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
  46. package/src/presentation/components/SettingsSection/README.md +47 -401
  47. package/src/presentation/hooks/README.md +95 -389
  48. package/src/presentation/hooks/mutations/README.md +99 -376
  49. package/src/presentation/hooks/queries/README.md +111 -353
  50. package/src/presentation/navigation/README.md +70 -502
  51. package/src/presentation/navigation/components/README.md +70 -295
  52. package/src/presentation/navigation/hooks/README.md +75 -367
  53. package/src/presentation/navigation/utils/README.md +100 -380
  54. package/src/presentation/screens/README.md +53 -504
  55. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  56. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  57. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  58. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  59. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  60. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  61. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  62. package/src/presentation/screens/hooks/README.md +64 -354
  63. package/src/presentation/screens/types/README.md +79 -409
  64. 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
- ## 🌟 Features
6
-
7
- ### Core Features
8
- - βœ… **User Settings Management** - Theme, language, notifications, privacy settings
9
- - βœ… **Zustand State Management** - Global settings state with Zustand
10
- - βœ… **Persistent Storage** - Uses @umituz/react-native-storage for persistence
11
- - βœ… **Settings Screens** - Pre-built settings screens with modular architecture
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
- ```bash
36
- npm install zustand @umituz/react-native-storage @umituz/react-native-design-system @umituz/react-native-localization @react-navigation/native @react-navigation/stack react-native-safe-area-context
37
- ```
38
-
39
- ## Usage
40
-
41
- ### Basic Settings Hook
42
-
43
- ```tsx
44
- import { useSettings } from '@umituz/react-native-settings';
45
-
46
- const MyComponent = () => {
47
- const { settings, loading, updateSettings, loadSettings } = useSettings();
48
-
49
- useEffect(() => {
50
- loadSettings('user123');
51
- }, []);
52
-
53
- const handleThemeChange = async () => {
54
- await updateSettings({ theme: 'dark' });
55
- };
56
-
57
- return (
58
- <View>
59
- <AtomicText>Current Theme: {settings?.theme}</AtomicText>
60
- <AtomicButton onPress={handleThemeChange}>Toggle Theme</AtomicButton>
61
- </View>
62
- );
63
- };
64
- ```
65
-
66
- ### Settings Screen
67
-
68
- ```tsx
69
- import { SettingsScreen } from '@umituz/react-native-settings';
70
-
71
- // Basic usage in navigation
72
- <Stack.Screen name="Settings" component={SettingsScreen} />
73
- ```
74
-
75
- ### Settings Item Card
76
-
77
- ```tsx
78
- import { SettingsItemCard } from '@umituz/react-native-settings';
79
-
80
- // Basic setting item
81
- <SettingsItemCard
82
- icon="brush-outline"
83
- title="Appearance"
84
- description="Theme and language settings"
85
- onPress={() => navigation.navigate('Appearance')}
86
- />
87
-
88
- // With switch
89
- <SettingsItemCard
90
- icon="notifications-outline"
91
- title="Notifications"
92
- showSwitch={true}
93
- switchValue={enabled}
94
- onSwitchChange={setEnabled}
95
- />
96
- ```
97
-
98
- ### Settings Section
99
-
100
- ```tsx
101
- import { SettingsSection, SettingsItemCard } from '@umituz/react-native-settings';
102
-
103
- <SettingsSection title="APP SETTINGS">
104
- <SettingsItemCard
105
- icon="brush-outline"
106
- title="Appearance"
107
- description="Theme and language settings"
108
- onPress={() => navigation.navigate('Appearance')}
109
- />
110
- <SettingsItemCard
111
- icon="notifications-outline"
112
- title="Notifications"
113
- showSwitch={true}
114
- switchValue={enabled}
115
- onSwitchChange={setEnabled}
116
- />
117
- </SettingsSection>
118
- ```
119
-
120
- ### User Profile Header Component
121
-
122
- ```tsx
123
- import { UserProfileHeader } from '@umituz/react-native-settings';
124
-
125
- <UserProfileHeader
126
- displayName="John Doe"
127
- userId="user123"
128
- isGuest={false}
129
- avatarUrl="https://example.com/avatar.jpg"
130
- accountSettingsRoute="AccountSettings"
131
- onPress={() => navigation.navigate('AccountSettings')}
132
- />
133
- ```
134
-
135
- ### Settings Footer Component
136
-
137
- ```tsx
138
- import { SettingsFooter } from '@umituz/react-native-settings';
139
-
140
- <SettingsFooter versionText="Version 1.0.0" />
141
- ```
142
-
143
- ### Disclaimer Setting Component
144
-
145
- ```tsx
146
- import { DisclaimerSetting } from '@umituz/react-native-settings';
147
-
148
- // Basic usage with translation keys
149
- <DisclaimerSetting />
150
-
151
- // Custom props
152
- <DisclaimerSetting
153
- titleKey="custom.disclaimer.title"
154
- messageKey="custom.disclaimer.message"
155
- shortMessageKey="custom.disclaimer.shortMessage"
156
- iconName="Info"
157
- iconColor="#F59E0B"
158
- modalTitle="Custom Disclaimer"
159
- modalContent="This is a custom disclaimer message for your app."
160
- />
161
- ```
162
-
163
- ### Cloud Sync Setting Component
164
-
165
- ```tsx
166
- import { CloudSyncSetting } from '@umituz/react-native-settings';
167
-
168
- // Basic usage
169
- <CloudSyncSetting />
170
-
171
- // With custom props
172
- <CloudSyncSetting
173
- title="Cloud Sync"
174
- description="Sync your data across devices"
175
- isSyncing={false}
176
- lastSynced={new Date()}
177
- onPress={() => handleSync()}
178
- iconColor="#3B82F6"
179
- />
180
- ```
181
-
182
- ### Settings Error Boundary
183
-
184
- ```tsx
185
- import { SettingsErrorBoundary } from '@umituz/react-native-settings';
186
-
187
- <SettingsErrorBoundary
188
- fallbackTitle="custom.error.title"
189
- fallbackMessage="custom.error.message"
190
- >
191
- <YourSettingsComponents />
192
- </SettingsErrorBoundary>
193
- ```
194
-
195
- ## API Reference
196
-
197
- ### `useSettings()`
198
-
199
- React hook for accessing settings state.
200
-
201
- **Returns:**
202
- - `settings: UserSettings | null` - Current settings
203
- - `loading: boolean` - Loading state
204
- - `error: string | null` - Error message
205
- - `loadSettings(userId: string)` - Load settings for user
206
- - `updateSettings(updates: Partial<UserSettings>)` - Update settings
207
- - `resetSettings(userId: string)` - Reset to default settings
208
- - `clearError()` - Clear error state
209
-
210
- ### `useSettingsStore()`
211
-
212
- Direct access to Zustand store.
213
-
214
- ### `SettingsScreen`
215
-
216
- Modern settings screen with organized sections and optional user profile header.
217
-
218
- **Props:**
219
- - `config?: SettingsConfig` - Configuration for which features to show
220
- - `showUserProfile?: boolean` - Show user profile header
221
- - `userProfile?: UserProfileHeaderProps` - User profile props
222
- - `showFooter?: boolean` - Show footer with version
223
- - `footerText?: string` - Custom footer text
224
-
225
- ### `AppearanceScreen`
226
-
227
- Appearance settings screen with language and theme controls.
228
-
229
- ### `LanguageSelectionScreen`
230
-
231
- Language selection screen with search functionality.
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
- ### `SettingsItemCard`
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
- Modern settings item component with Ionicons support and switch support.
236
-
237
- **Props:**
238
- - `icon: IconName` - Icon name from Ionicons
239
- - `title: string` - Main title text
240
- - `description?: string` - Optional description/value text (shown below title)
241
- - `onPress?: () => void` - Callback when pressed
242
- - `showSwitch?: boolean` - Show switch instead of chevron
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
- interface UserSettings {
333
- userId: string;
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
- ⚠️ **Storage**: This package uses `@umituz/react-native-storage` for all storage operations. Make sure to install it as a peer dependency.
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
- ### Custom Settings Screen
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/ # Feature domains (DDD architecture)
483
- β”‚ β”œβ”€β”€ about/ # App information & about
484
- β”‚ β”œβ”€β”€ appearance/ # Theme & appearance settings
485
- β”‚ β”œβ”€β”€ legal/ # Privacy policy & terms
486
- β”‚ β”œβ”€β”€ disclaimer/ # Legal disclaimers
487
- β”‚ β”œβ”€β”€ feedback/ # User feedback system
488
- β”‚ β”œβ”€β”€ faqs/ # FAQ management
489
- β”‚ β”œβ”€β”€ rating/ # Rating system
490
- β”‚ β”œβ”€β”€ video-tutorials/ # Video tutorials
491
- β”‚ β”œβ”€β”€ cloud-sync/ # Cloud synchronization
492
- β”‚ └── dev/ # Development tools
493
- β”œβ”€β”€ presentation/ # Shared UI components
494
- β”‚ β”œβ”€β”€ screens/ # Settings screens
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
- ## Version History
328
+ ## Related Documentation
503
329
 
504
- - **v4.20.56**: Added comprehensive domain documentation with README files for each feature
505
- - **v4.20.55**: Enhanced domain structure with individual README documentation
506
- - **v4.20.54**: Refactored package structure - split files under 200 lines
507
- - **v2.2.0**: Major refactor - removed hardcoded text, improved architecture, added comprehensive tests
508
- - **v2.1.0**: Enhanced component structure and TypeScript support
509
- - **v2.0.0**: Breaking changes - removed LanguageSelectionScreen, improved API
510
- - **v1.x.x**: Initial releases with basic settings functionality
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
- ## Contributing
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
- When contributing to this package:
515
- 1. Follow the domain-driven design structure
516
- 2. Keep files under 200 lines
517
- 3. Add tests for new features
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
- ## Author
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.