@umituz/react-native-settings 4.20.57 → 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 (65) 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/__tests__/setup.ts +1 -4
  19. package/src/application/README.md +85 -271
  20. package/src/domains/about/README.md +85 -440
  21. package/src/domains/about/presentation/hooks/README.md +93 -348
  22. package/src/domains/appearance/README.md +95 -584
  23. package/src/domains/appearance/hooks/README.md +95 -303
  24. package/src/domains/appearance/infrastructure/services/README.md +83 -397
  25. package/src/domains/appearance/presentation/components/README.md +99 -0
  26. package/src/domains/cloud-sync/README.md +73 -439
  27. package/src/domains/cloud-sync/presentation/components/README.md +95 -493
  28. package/src/domains/dev/README.md +71 -457
  29. package/src/domains/disclaimer/README.md +77 -411
  30. package/src/domains/disclaimer/presentation/components/README.md +95 -392
  31. package/src/domains/faqs/README.md +86 -574
  32. package/src/domains/feedback/README.md +79 -553
  33. package/src/domains/feedback/presentation/hooks/README.md +93 -426
  34. package/src/domains/legal/README.md +88 -537
  35. package/src/domains/rating/README.md +73 -440
  36. package/src/domains/rating/presentation/components/README.md +95 -475
  37. package/src/domains/video-tutorials/README.md +77 -470
  38. package/src/domains/video-tutorials/presentation/components/README.md +95 -431
  39. package/src/infrastructure/README.md +78 -425
  40. package/src/infrastructure/repositories/README.md +88 -420
  41. package/src/infrastructure/services/README.md +74 -460
  42. package/src/presentation/components/README.md +97 -480
  43. package/src/presentation/components/SettingsErrorBoundary/README.md +48 -442
  44. package/src/presentation/components/SettingsFooter/README.md +48 -427
  45. package/src/presentation/components/SettingsItemCard/README.md +153 -392
  46. package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
  47. package/src/presentation/components/SettingsSection/README.md +47 -401
  48. package/src/presentation/hooks/README.md +95 -389
  49. package/src/presentation/hooks/mutations/README.md +99 -376
  50. package/src/presentation/hooks/queries/README.md +111 -353
  51. package/src/presentation/navigation/README.md +70 -502
  52. package/src/presentation/navigation/components/README.md +70 -295
  53. package/src/presentation/navigation/hooks/README.md +75 -367
  54. package/src/presentation/navigation/utils/README.md +100 -380
  55. package/src/presentation/screens/README.md +53 -504
  56. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  57. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  58. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  59. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  60. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  61. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  62. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  63. package/src/presentation/screens/hooks/README.md +64 -354
  64. package/src/presentation/screens/types/README.md +79 -409
  65. package/src/presentation/screens/utils/README.md +65 -255
@@ -1,350 +1,95 @@
1
1
  # useAboutInfo Hook
2
2
 
3
- Custom hook for managing app information display in the About screen and components.
4
-
5
- ## Features
6
-
7
- - **App Info**: Retrieves app name, version, build number
8
- - **Developer Info**: Gets developer contact details
9
- - **Formatted Data**: Provides formatted strings for display
10
- - **Cached**: Memoized for performance
11
- - **Customizable**: Supports custom app info injection
12
-
13
- ## Installation
14
-
15
- This hook is part of `@umituz/react-native-settings`.
16
-
17
- ## Usage
18
-
19
- ### Basic Usage
20
-
21
- ```tsx
22
- import { useAboutInfo } from '@umituz/react-native-settings';
23
-
24
- function AboutScreen() {
25
- const { appInfo, developerInfo, versionString, isLoading } = useAboutInfo();
26
-
27
- if (isLoading) return <LoadingSpinner />;
28
-
29
- return (
30
- <View>
31
- <Text>{appInfo.name}</Text>
32
- <Text>{versionString}</Text>
33
- <Text>{developerInfo.name}</Text>
34
- </View>
35
- );
36
- }
37
- ```
38
-
39
- ### With Custom App Info
40
-
41
- ```tsx
42
- function AboutScreen() {
43
- const customAppInfo = {
44
- name: 'My App',
45
- version: '2.0.0',
46
- buildNumber: '200',
47
- developer: 'My Company',
48
- contactEmail: 'support@example.com',
49
- websiteUrl: 'https://example.com',
50
- };
51
-
52
- const { appInfo, versionString } = useAboutInfo(customAppInfo);
53
-
54
- return (
55
- <View>
56
- <Text>{appInfo.name}</Text>
57
- <Text>Version {versionString}</Text>
58
- </View>
59
- );
60
- }
61
- ```
62
-
63
- ## Return Value
64
-
65
- ```typescript
66
- interface UseAboutInfoResult {
67
- appInfo: {
68
- name: string; // App name
69
- version: string; // App version
70
- buildNumber: string; // Build number
71
- developer: string; // Developer name
72
- contactEmail?: string; // Contact email
73
- websiteUrl?: string; // Website URL
74
- websiteDisplay?: string; // Website display text
75
- moreAppsUrl?: string; // More apps URL
76
- };
77
- versionString: string; // Formatted version (e.g., "Version 1.0.0 (100)")
78
- developerInfo: {
79
- name: string; // Developer name
80
- email?: string; // Developer email
81
- website?: string; // Developer website
82
- };
83
- isLoading: boolean; // Loading state
84
- }
85
- ```
86
-
87
- ## Examples
88
-
89
- ### Display App Information
90
-
91
- ```tsx
92
- function AboutContent() {
93
- const { appInfo, versionString, isLoading } = useAboutInfo();
94
-
95
- if (isLoading) {
96
- return <ActivityIndicator />;
97
- }
98
-
99
- return (
100
- <View style={styles.container}>
101
- <Text style={styles.appName}>{appInfo.name}</Text>
102
- <Text style={styles.version}>{versionString}</Text>
103
-
104
- {appInfo.developer && (
105
- <Text style={styles.developer}>
106
- Made by {appInfo.developer}
107
- </Text>
108
- )}
109
- </View>
110
- );
111
- }
112
- ```
113
-
114
- ### Contact Actions
115
-
116
- ```tsx
117
- function AboutActions() {
118
- const { appInfo } = useAboutInfo();
119
-
120
- const handleEmailPress = useCallback(() => {
121
- if (appInfo.contactEmail) {
122
- Linking.openURL(`mailto:${appInfo.contactEmail}`);
123
- }
124
- }, [appInfo.contactEmail]);
125
-
126
- const handleWebsitePress = useCallback(() => {
127
- if (appInfo.websiteUrl) {
128
- Linking.openURL(appInfo.websiteUrl);
129
- }
130
- }, [appInfo.websiteUrl]);
131
-
132
- return (
133
- <View>
134
- <Button
135
- title="Contact Support"
136
- onPress={handleEmailPress}
137
- disabled={!appInfo.contactEmail}
138
- />
139
- <Button
140
- title="Visit Website"
141
- onPress={handleWebsitePress}
142
- disabled={!appInfo.websiteUrl}
143
- />
144
- </View>
145
- );
146
- }
147
- ```
148
-
149
- ### More Apps Link
150
-
151
- ```tsx
152
- function MoreAppsButton() {
153
- const { appInfo } = useAboutInfo();
154
-
155
- if (!appInfo.moreAppsUrl) {
156
- return null;
157
- }
158
-
159
- return (
160
- <TouchableOpacity
161
- onPress={() => Linking.openURL(appInfo.moreAppsUrl)}
162
- style={styles.button}
163
- >
164
- <Text style={styles.buttonText}>
165
- More Apps by {appInfo.developer}
166
- </Text>
167
- </TouchableOpacity>
168
- );
169
- }
170
- ```
171
-
172
- ### Custom Version Display
173
-
174
- ```tsx
175
- function VersionDisplay() {
176
- const { appInfo } = useAboutInfo();
177
-
178
- return (
179
- <View style={styles.versionContainer}>
180
- <View style={styles.versionBadge}>
181
- <Text style={styles.versionText}>
182
- v{appInfo.version}
183
- </Text>
184
- </View>
185
-
186
- {__DEV__ && (
187
- <Text style={styles.buildText}>
188
- Build {appInfo.buildNumber}
189
- </Text>
190
- )}
191
- </View>
192
- );
193
- }
194
- ```
195
-
196
- ### With Loading State
197
-
198
- ```tsx
199
- function AboutScreen() {
200
- const { appInfo, versionString, isLoading } = useAboutInfo();
201
-
202
- return (
203
- <ScrollView>
204
- {isLoading ? (
205
- <View style={styles.loading}>
206
- <ActivityIndicator size="large" />
207
- <Text>Loading app info...</Text>
208
- </View>
209
- ) : (
210
- <>
211
- <AboutHeader appInfo={appInfo} />
212
- <AboutVersion versionString={versionString} />
213
- <AboutDeveloper developerInfo={appInfo.developer} />
214
- </>
215
- )}
216
- </ScrollView>
217
- );
218
- }
219
- ```
220
-
221
- ### With Error Handling
222
-
223
- ```tsx
224
- function AboutScreen() {
225
- const { appInfo, versionString, isLoading, error } = useAboutInfo();
226
-
227
- if (error) {
228
- return (
229
- <View style={styles.error}>
230
- <Text>Failed to load app information</Text>
231
- <Button title="Retry" onPress={refetch} />
232
- </View>
233
- );
234
- }
235
-
236
- if (isLoading) {
237
- return <LoadingSpinner />;
238
- }
239
-
240
- return <AboutContent appInfo={appInfo} versionString={versionString} />;
241
- }
242
- ```
243
-
244
- ## Data Sources
245
-
246
- ### From App Config
247
-
248
- ```tsx
249
- import Constants from 'expo-constants';
250
-
251
- function useAboutInfo() {
252
- const appInfo = useMemo(() => ({
253
- name: Constants.expoConfig.name,
254
- version: Constants.expoConfig.version,
255
- buildNumber: Constants.expoConfig.ios?.buildNumber ||
256
- Constants.expoConfig.android?.versionCode,
257
- }), []);
258
-
259
- return { appInfo };
260
- }
261
- ```
262
-
263
- ### From Custom Props
264
-
265
- ```tsx
266
- function useAboutInfo(customAppInfo?: AppInfo) {
267
- const defaultAppInfo = {
268
- name: 'My App',
269
- version: '1.0.0',
270
- buildNumber: '1',
271
- };
272
-
273
- const appInfo = useMemo(() => ({
274
- ...defaultAppInfo,
275
- ...customAppInfo,
276
- }), [customAppInfo]);
277
-
278
- return { appInfo };
279
- }
280
- ```
281
-
282
- ### From Repository
283
-
284
- ```tsx
285
- function useAboutInfo() {
286
- const { data, isLoading } = useQuery(['appInfo'], fetchAppInfo);
287
-
288
- const appInfo = useMemo(() => ({
289
- name: data?.name,
290
- version: data?.version,
291
- buildNumber: data?.buildNumber,
292
- developer: data?.developer,
293
- }), [data]);
294
-
295
- return { appInfo, isLoading };
296
- }
297
- ```
298
-
299
- ## Formatting Helpers
300
-
301
- ### Version String
302
-
303
- ```tsx
304
- const versionString = useMemo(() => {
305
- if (appInfo.buildNumber) {
306
- return `Version ${appInfo.version} (${appInfo.buildNumber})`;
307
- }
308
- return `Version ${appInfo.version}`;
309
- }, [appInfo.version, appInfo.buildNumber]);
310
- ```
311
-
312
- ### Developer String
313
-
314
- ```tsx
315
- const developerString = useMemo(() => {
316
- if (appInfo.contactEmail && appInfo.websiteUrl) {
317
- return `${appInfo.developer}\n${appInfo.contactEmail}\n${appInfo.websiteUrl}`;
318
- }
319
- return appInfo.developer || '';
320
- }, [appInfo.developer, appInfo.contactEmail, appInfo.websiteUrl]);
321
- ```
322
-
323
- ### Copyright String
324
-
325
- ```tsx
326
- const copyrightString = useMemo(() => {
327
- const year = new Date().getFullYear();
328
- return `© ${year} ${appInfo.developer}. All rights reserved.`;
329
- }, [appInfo.developer]);
330
- ```
331
-
332
- ## Best Practices
333
-
334
- 1. **Memoization**: Use useMemo for expensive calculations
335
- 2. **Loading States**: Show loading indicator while fetching
336
- 3. **Error Handling**: Handle errors gracefully
337
- 4. **Caching**: Cache app info to avoid repeated fetches
338
- 5. **Validation**: Validate app info before displaying
339
- 6. **Accessibility**: Ensure all info is accessible
340
- 7. **Type Safety**: Use TypeScript for type checking
341
-
342
- ## Related
343
-
344
- - **AboutScreen**: About screen component
345
- - **AboutContent**: About content component
346
- - **AppInfo Type**: App info type definition
347
-
348
- ## License
349
-
350
- MIT
3
+ ## Purpose
4
+
5
+ Custom hook for managing app information display in the About screen and components. Retrieves and formats app metadata including version, build number, developer information, and contact details for comprehensive about sections.
6
+
7
+ ## File Paths
8
+
9
+ - **useAboutInfo**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/hooks/useAboutInfo.ts`
10
+ - **About Components**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/components/`
11
+ - **About Screen**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/screens/AboutScreen.tsx`
12
+
13
+ ## Strategy
14
+
15
+ 1. **Data Aggregation**: Centralizes app information from multiple sources including app config, custom props, and external repositories to provide a single, consistent interface for accessing app metadata.
16
+
17
+ 2. **Performance Optimization**: Uses memoization (useMemo) to cache formatted strings and computed values, preventing unnecessary recalculations and re-renders.
18
+
19
+ 3. **Flexible Configuration**: Supports both automatic data retrieval from Expo constants and manual injection of custom app info, making it suitable for various app configurations and testing scenarios.
20
+
21
+ 4. **User-Friendly Formatting**: Provides pre-formatted strings for common display patterns (version strings, developer info) reducing boilerplate in components.
22
+
23
+ 5. **Loading State Management**: Handles asynchronous data fetching with proper loading states, ensuring smooth user experience during data retrieval.
24
+
25
+ ## Restrictions
26
+
27
+ ### DO NOT
28
+
29
+ - Fetch app info on every render - use memoization
30
+ - Assume all app info fields are available - handle optional fields
31
+ - Mix data fetching logic with formatting logic
32
+ - Create multiple instances of the hook for the same data
33
+ - Hardcode app-specific values in the hook
34
+
35
+ ### ❌ NEVER
36
+
37
+ - Mutate the returned appInfo object
38
+ - Use the hook outside of React components or custom hooks
39
+ - Store sensitive information (API keys, secrets) in app info
40
+ - Bypass loading states when data is being fetched
41
+ - Return undefined or null for required fields
42
+
43
+ ### AVOID
44
+
45
+ - Making unnecessary network requests for static app info
46
+ - Complex formatting logic in components - use the hook's formatted values
47
+ - Storing large data objects in app info
48
+ - Frequent refetching of app metadata
49
+ - Overly complex validation logic in the hook
50
+
51
+ ## Rules
52
+
53
+ ### ✅ ALWAYS
54
+
55
+ - Use useMemo for expensive calculations and formatting
56
+ - Provide loading states when fetching data asynchronously
57
+ - Validate app info before displaying to users
58
+ - Handle missing or undefined optional fields gracefully
59
+ - Return consistent object structure regardless of data source
60
+
61
+ ### ✅ MUST
62
+
63
+ - Return appInfo with all standard fields (name, version, buildNumber)
64
+ - Provide versionString in a user-friendly format
65
+ - Include developer information when available
66
+ - Handle errors gracefully with appropriate error states
67
+ - Cache results to prevent performance issues
68
+
69
+ ### SHOULD
70
+
71
+ - Support custom app info injection for testing
72
+ - Format version strings to include build numbers in development
73
+ - Provide contact information (email, website) when available
74
+ - Include "More Apps" URL when applicable
75
+ - Use TypeScript interfaces for type safety
76
+ - Document all available app info fields
77
+
78
+ ## AI Agent Guidelines
79
+
80
+ 1. **Data Source Priority**: Use app config (expo-constants) as the primary data source. Fall back to custom props or static values only when app config is unavailable or for testing purposes.
81
+
82
+ 2. **Formatting Standards**: Always use the provided formatted values (versionString, developerInfo) instead of manually formatting app info in components. This ensures consistency across the app.
83
+
84
+ 3. **Loading States**: Display appropriate loading indicators while fetching app info. Show skeleton screens or spinners rather than partially loaded information.
85
+
86
+ 4. **Error Handling**: Implement graceful error handling when app info fails to load. Provide fallback values or default information to ensure the about screen remains functional.
87
+
88
+ 5. **Optional Fields**: Always check if optional fields (contactEmail, websiteUrl, moreAppsUrl) exist before displaying them. Use conditional rendering to avoid showing empty or null values.
89
+
90
+ ## Reference
91
+
92
+ - **Hook Implementation**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/hooks/useAboutInfo.ts`
93
+ - **About Screen**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/screens/AboutScreen.tsx`
94
+ - **App Config**: Check `app.config.js` or `app.json` for app metadata
95
+ - **About Components**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/about/presentation/components/`