@umituz/react-native-settings 4.20.56 → 4.20.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -3
- package/package.json +1 -2
- package/src/application/README.md +322 -0
- package/src/domains/about/README.md +452 -0
- package/src/domains/about/presentation/hooks/README.md +350 -0
- package/src/domains/appearance/README.md +596 -0
- package/src/domains/appearance/hooks/README.md +366 -0
- package/src/domains/appearance/infrastructure/services/README.md +455 -0
- package/src/domains/cloud-sync/README.md +451 -0
- package/src/domains/cloud-sync/presentation/components/README.md +493 -0
- package/src/domains/dev/README.md +477 -0
- package/src/domains/disclaimer/README.md +421 -0
- package/src/domains/disclaimer/presentation/components/README.md +394 -0
- package/src/domains/faqs/README.md +586 -0
- package/src/domains/feedback/README.md +565 -0
- package/src/domains/feedback/presentation/hooks/README.md +428 -0
- package/src/domains/legal/README.md +549 -0
- package/src/domains/rating/README.md +452 -0
- package/src/domains/rating/presentation/components/README.md +475 -0
- package/src/domains/video-tutorials/README.md +482 -0
- package/src/domains/video-tutorials/presentation/components/README.md +433 -0
- package/src/infrastructure/README.md +509 -0
- package/src/infrastructure/repositories/README.md +475 -0
- package/src/infrastructure/services/README.md +510 -0
- package/src/presentation/components/README.md +482 -0
- package/src/presentation/components/SettingsErrorBoundary/README.md +461 -0
- package/src/presentation/components/SettingsFooter/README.md +446 -0
- package/src/presentation/components/SettingsItemCard/README.md +457 -0
- package/src/presentation/components/SettingsSection/README.md +421 -0
- package/src/presentation/hooks/README.md +413 -0
- package/src/presentation/hooks/mutations/README.md +430 -0
- package/src/presentation/hooks/queries/README.md +441 -0
- package/src/presentation/navigation/README.md +532 -0
- package/src/presentation/navigation/components/README.md +330 -0
- package/src/presentation/navigation/hooks/README.md +399 -0
- package/src/presentation/navigation/utils/README.md +442 -0
- package/src/presentation/screens/README.md +525 -0
- package/src/presentation/screens/components/SettingsContent/README.md +404 -0
- package/src/presentation/screens/components/SettingsHeader/README.md +322 -0
- package/src/presentation/screens/components/sections/CustomSettingsList/README.md +388 -0
- package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +232 -0
- package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +325 -0
- package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +480 -0
- package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +391 -0
- package/src/presentation/screens/hooks/README.md +383 -0
- package/src/presentation/screens/types/README.md +439 -0
- package/src/presentation/screens/utils/README.md +288 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
# Disclaimer Domain
|
|
2
|
+
|
|
3
|
+
The Disclaimer domain provides components for displaying legal notices, warnings, and important information to users in your React Native app through cards, modals, and dedicated screens.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Disclaimer Card**: Compact card component for displaying disclaimer summary
|
|
8
|
+
- **Disclaimer Modal**: Full-screen modal with scrollable content
|
|
9
|
+
- **Disclaimer Setting**: Integrated card + modal component
|
|
10
|
+
- **Disclaimer Screen**: Dedicated screen for comprehensive disclaimers
|
|
11
|
+
- **Internationalization**: Full i18n support with translation keys
|
|
12
|
+
- **Customizable Icons**: Custom icons and colors for different warning levels
|
|
13
|
+
- **Cross-Platform**: Universal design for iOS, Android, and Web
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
This domain is part of `@umituz/react-native-settings`. Install the package to use it:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @umituz/react-native-settings
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Components
|
|
24
|
+
|
|
25
|
+
### DisclaimerSetting
|
|
26
|
+
|
|
27
|
+
The main component that displays a disclaimer card and opens a modal when tapped.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
31
|
+
|
|
32
|
+
function MySettingsScreen() {
|
|
33
|
+
return (
|
|
34
|
+
<View>
|
|
35
|
+
<DisclaimerSetting />
|
|
36
|
+
</View>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Props
|
|
42
|
+
|
|
43
|
+
| Prop | Type | Default | Description |
|
|
44
|
+
|------|------|---------|-------------|
|
|
45
|
+
| `titleKey` | `string` | `'settings.disclaimer.title'` | Translation key for title |
|
|
46
|
+
| `messageKey` | `string` | `'settings.disclaimer.message'` | Translation key for full message |
|
|
47
|
+
| `shortMessageKey` | `string` | `'settings.disclaimer.shortMessage'` | Translation key for short message |
|
|
48
|
+
| `iconName` | `string` | `'alert-triangle'` | Icon name from design system |
|
|
49
|
+
| `iconColor` | `string` | `tokens.colors.warning` | Custom icon color |
|
|
50
|
+
| `backgroundColor` | `string` | `withAlpha(iconColor, 0.1)` | Custom background color |
|
|
51
|
+
| `modalTitle` | `string` | `undefined` | Override modal title (bypasses i18n) |
|
|
52
|
+
| `modalContent` | `string` | `undefined` | Override modal content (bypasses i18n) |
|
|
53
|
+
|
|
54
|
+
#### Example with Custom Content
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
58
|
+
|
|
59
|
+
function CustomDisclaimer() {
|
|
60
|
+
return (
|
|
61
|
+
<DisclaimerSetting
|
|
62
|
+
modalTitle="Beta Version Notice"
|
|
63
|
+
modalContent="This is a beta version of the app. Features may change and bugs may occur. Use at your own risk."
|
|
64
|
+
iconName="flask"
|
|
65
|
+
iconColor="#9333EA"
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### DisclaimerCard
|
|
72
|
+
|
|
73
|
+
A compact card displaying disclaimer summary with icon and message.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { DisclaimerCard } from '@umituz/react-native-settings';
|
|
77
|
+
|
|
78
|
+
function DisclaimerCardExample() {
|
|
79
|
+
return (
|
|
80
|
+
<DisclaimerCard
|
|
81
|
+
title="Warning"
|
|
82
|
+
shortMessage="This is an important notice"
|
|
83
|
+
iconName="alert-triangle"
|
|
84
|
+
iconColor="#F59E0B"
|
|
85
|
+
backgroundColor="rgba(245, 158, 11, 0.1)"
|
|
86
|
+
onPress={() => console.log('Card pressed')}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Props
|
|
93
|
+
|
|
94
|
+
| Prop | Type | Default | Description |
|
|
95
|
+
|------|------|---------|-------------|
|
|
96
|
+
| `title` | `string` | **Required** | Card title |
|
|
97
|
+
| `shortMessage` | `string` | **Required** | Short message text |
|
|
98
|
+
| `iconName` | `string` | **Required** | Icon name |
|
|
99
|
+
| `iconColor` | `string` | **Required** | Icon color |
|
|
100
|
+
| `backgroundColor` | `string` | **Required** | Background color |
|
|
101
|
+
| `onPress` | `() => void` | **Required** | Press handler |
|
|
102
|
+
|
|
103
|
+
### DisclaimerModal
|
|
104
|
+
|
|
105
|
+
Full-screen modal with scrollable disclaimer content.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { DisclaimerModal } from '@umituz/react-native-settings';
|
|
109
|
+
|
|
110
|
+
function DisclaimerModalExample() {
|
|
111
|
+
const [visible, setVisible] = useState(false);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<DisclaimerModal
|
|
115
|
+
visible={visible}
|
|
116
|
+
title="Legal Disclaimer"
|
|
117
|
+
content="Full disclaimer content goes here..."
|
|
118
|
+
onClose={() => setVisible(false)}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Props
|
|
125
|
+
|
|
126
|
+
| Prop | Type | Default | Description |
|
|
127
|
+
|------|------|---------|-------------|
|
|
128
|
+
| `visible` | `boolean` | **Required** | Modal visibility |
|
|
129
|
+
| `title` | `string` | **Required** | Modal title |
|
|
130
|
+
| `content` | `string` | **Required** | Modal content |
|
|
131
|
+
| `onClose` | `() => void` | **Required** | Close handler |
|
|
132
|
+
|
|
133
|
+
### DisclaimerScreen
|
|
134
|
+
|
|
135
|
+
A dedicated screen for displaying comprehensive disclaimer information.
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
import { DisclaimerScreen } from '@umituz/react-native-settings';
|
|
139
|
+
|
|
140
|
+
function DisclaimerScreenExample() {
|
|
141
|
+
return (
|
|
142
|
+
<DisclaimerScreen
|
|
143
|
+
title="Disclaimer"
|
|
144
|
+
content="This is the full disclaimer text..."
|
|
145
|
+
iconName="alert-circle"
|
|
146
|
+
iconColor="#DC2626"
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
#### Props
|
|
153
|
+
|
|
154
|
+
| Prop | Type | Default | Description |
|
|
155
|
+
|------|------|---------|-------------|
|
|
156
|
+
| `title` | `string` | **Required** | Screen title |
|
|
157
|
+
| `content` | `string` | **Required** | Disclaimer content |
|
|
158
|
+
| `iconName` | `string` | `undefined` | Custom icon name |
|
|
159
|
+
| `iconColor` | `string` | `undefined` | Custom icon color |
|
|
160
|
+
|
|
161
|
+
## Examples
|
|
162
|
+
|
|
163
|
+
### Basic Usage with i18n
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
167
|
+
|
|
168
|
+
function SettingsScreen() {
|
|
169
|
+
return (
|
|
170
|
+
<ScrollView>
|
|
171
|
+
{/* Other settings */}
|
|
172
|
+
|
|
173
|
+
<DisclaimerSetting />
|
|
174
|
+
</ScrollView>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// In your localization files:
|
|
179
|
+
// en.json:
|
|
180
|
+
// {
|
|
181
|
+
// "settings": {
|
|
182
|
+
// "disclaimer": {
|
|
183
|
+
// "title": "Disclaimer",
|
|
184
|
+
// "message": "This is the full disclaimer content...",
|
|
185
|
+
// "shortMessage": "Important legal information"
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
// }
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Custom Medical Disclaimer
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
195
|
+
|
|
196
|
+
function MedicalAppSettings() {
|
|
197
|
+
return (
|
|
198
|
+
<DisclaimerSetting
|
|
199
|
+
modalTitle="Medical Disclaimer"
|
|
200
|
+
modalContent="This app is for informational purposes only and is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition."
|
|
201
|
+
iconName="heart-pulse"
|
|
202
|
+
iconColor="#DC2626"
|
|
203
|
+
/>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Financial Warning
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
212
|
+
|
|
213
|
+
function FinancialAppSettings() {
|
|
214
|
+
return (
|
|
215
|
+
<DisclaimerSetting
|
|
216
|
+
modalTitle="Risk Warning"
|
|
217
|
+
modalContent="Trading financial instruments carries a high level of risk and may not be suitable for all investors. You could lose all of your invested capital. Past performance is not indicative of future results."
|
|
218
|
+
iconName="trending-down"
|
|
219
|
+
iconColor="#7C3AED"
|
|
220
|
+
/>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Beta Software Notice
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
229
|
+
|
|
230
|
+
function BetaAppSettings() {
|
|
231
|
+
return (
|
|
232
|
+
<DisclaimerSetting
|
|
233
|
+
modalTitle="Beta Software Notice"
|
|
234
|
+
modalContent="This is pre-release software. Features may be incomplete or change before final release. Data may be lost. Please back up your important data before using."
|
|
235
|
+
iconName="flask"
|
|
236
|
+
iconColor="#0891B2"
|
|
237
|
+
/>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Custom Card without Modal
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { DisclaimerCard } from '@umituz/react-native-settings';
|
|
246
|
+
|
|
247
|
+
function CustomDisclaimerCard() {
|
|
248
|
+
return (
|
|
249
|
+
<DisclaimerCard
|
|
250
|
+
title="Age Restriction"
|
|
251
|
+
shortMessage="You must be 18+ to use this app"
|
|
252
|
+
iconName="shield"
|
|
253
|
+
iconColor="#059669"
|
|
254
|
+
backgroundColor="rgba(5, 150, 105, 0.1)"
|
|
255
|
+
onPress={() => {
|
|
256
|
+
// Navigate to verification screen
|
|
257
|
+
navigation.navigate('AgeVerification');
|
|
258
|
+
}}
|
|
259
|
+
/>
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Standalone Modal
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
import { DisclaimerModal, useState } from '@umituz/react-native-settings';
|
|
268
|
+
|
|
269
|
+
function TermsModal() {
|
|
270
|
+
const [visible, setVisible] = useState(false);
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<View>
|
|
274
|
+
<Button
|
|
275
|
+
title="Show Disclaimer"
|
|
276
|
+
onPress={() => setVisible(true)}
|
|
277
|
+
/>
|
|
278
|
+
|
|
279
|
+
<DisclaimerModal
|
|
280
|
+
visible={visible}
|
|
281
|
+
title="Terms & Conditions"
|
|
282
|
+
content="By using this app, you agree to our terms..."
|
|
283
|
+
onClose={() => setVisible(false)}
|
|
284
|
+
/>
|
|
285
|
+
</View>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Custom Disclaimer Screen
|
|
291
|
+
|
|
292
|
+
```tsx
|
|
293
|
+
import { DisclaimerScreen } from '@umituz/react-native-settings';
|
|
294
|
+
|
|
295
|
+
function LegalDisclaimerStack() {
|
|
296
|
+
return (
|
|
297
|
+
<Stack.Navigator>
|
|
298
|
+
<Stack.Screen
|
|
299
|
+
name="Disclaimer"
|
|
300
|
+
component={DisclaimerScreen}
|
|
301
|
+
initialParams={{
|
|
302
|
+
title: 'Legal Disclaimer',
|
|
303
|
+
content: 'Full legal disclaimer text...',
|
|
304
|
+
iconName: 'gavel',
|
|
305
|
+
iconColor: '#DC2626',
|
|
306
|
+
}}
|
|
307
|
+
/>
|
|
308
|
+
</Stack.Navigator>
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Translation Keys
|
|
314
|
+
|
|
315
|
+
The default DisclaimerSetting uses these translation keys. Make sure to include them in your localization files:
|
|
316
|
+
|
|
317
|
+
```json
|
|
318
|
+
{
|
|
319
|
+
"settings": {
|
|
320
|
+
"disclaimer": {
|
|
321
|
+
"title": "Disclaimer",
|
|
322
|
+
"message": "Full disclaimer text that appears in the modal...",
|
|
323
|
+
"shortMessage": "Important notice - tap to read more"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Styling
|
|
330
|
+
|
|
331
|
+
The disclaimer components use the design system tokens for consistent styling:
|
|
332
|
+
|
|
333
|
+
- **Icon Size**: Medium (24px)
|
|
334
|
+
- **Card Background**: Semi-transparent version of icon color
|
|
335
|
+
- **Modal Animation**: Slide from bottom (iOS) / Fade (Android)
|
|
336
|
+
- **Text**: Uses design system typography tokens
|
|
337
|
+
|
|
338
|
+
Custom colors are supported through props:
|
|
339
|
+
|
|
340
|
+
```tsx
|
|
341
|
+
<DisclaimerSetting
|
|
342
|
+
iconColor="#DC2626" // Red for critical
|
|
343
|
+
iconColor="#F59E0B" // Amber for warning
|
|
344
|
+
iconColor="#3B82F6" // Blue for info
|
|
345
|
+
iconColor="#10B981" // Emerald for success
|
|
346
|
+
/>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## Architecture
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
src/domains/disclaimer/
|
|
353
|
+
├── presentation/
|
|
354
|
+
│ ├── screens/
|
|
355
|
+
│ │ └── DisclaimerScreen.tsx
|
|
356
|
+
│ ├── components/
|
|
357
|
+
│ │ ├── DisclaimerSetting.tsx # Main component
|
|
358
|
+
│ │ ├── DisclaimerCard.tsx # Card component
|
|
359
|
+
│ │ └── DisclaimerModal.tsx # Modal component
|
|
360
|
+
│ └── components/__tests__/ # Component tests
|
|
361
|
+
└── index.ts # Public API exports
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Best Practices
|
|
365
|
+
|
|
366
|
+
1. **Keep Messages Clear**: Use simple, non-technical language
|
|
367
|
+
2. **Be Specific**: Clearly state what the disclaimer covers
|
|
368
|
+
3. **Short + Full**: Use short message on card, full content in modal
|
|
369
|
+
4. **Color Coding**: Use appropriate colors for warning levels:
|
|
370
|
+
- Red: Critical/legal warnings
|
|
371
|
+
- Amber: Cautionary notices
|
|
372
|
+
- Blue: Informational
|
|
373
|
+
- Emerald: Confirmations
|
|
374
|
+
5. **Test Translations**: Ensure all languages have proper translations
|
|
375
|
+
6. **Accessibility**: Icons should have proper accessibility labels
|
|
376
|
+
7. **Cross-Platform**: Test on iOS, Android, and Web
|
|
377
|
+
|
|
378
|
+
## Testing
|
|
379
|
+
|
|
380
|
+
```tsx
|
|
381
|
+
import { render, fireEvent } from '@testing-library/react-native';
|
|
382
|
+
import { DisclaimerSetting } from '@umituz/react-native-settings';
|
|
383
|
+
|
|
384
|
+
describe('DisclaimerSetting', () => {
|
|
385
|
+
it('renders disclaimer card', () => {
|
|
386
|
+
const { getByText } = render(<DisclaimerSetting />);
|
|
387
|
+
expect(getByText(/disclaimer/i)).toBeTruthy();
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('opens modal on card press', () => {
|
|
391
|
+
const { getByText, getByTestId } = render(<DisclaimerSetting />);
|
|
392
|
+
|
|
393
|
+
fireEvent.press(getByText(/disclaimer/i));
|
|
394
|
+
expect(getByTestId('close-disclaimer-modal')).toBeTruthy();
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
it('closes modal on close button press', () => {
|
|
398
|
+
const { getByText, getByTestId, queryByTestId } = render(
|
|
399
|
+
<DisclaimerSetting />
|
|
400
|
+
);
|
|
401
|
+
|
|
402
|
+
// Open modal
|
|
403
|
+
fireEvent.press(getByText(/disclaimer/i));
|
|
404
|
+
|
|
405
|
+
// Close modal
|
|
406
|
+
fireEvent.press(getByTestId('close-disclaimer-modal'));
|
|
407
|
+
|
|
408
|
+
expect(queryByTestId('close-disclaimer-modal')).toBeNull();
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
## Related
|
|
414
|
+
|
|
415
|
+
- **Legal Domain**: Privacy policy, terms of service
|
|
416
|
+
- **Settings Domain**: Main settings management
|
|
417
|
+
- **Design System**: Icons, colors, and typography
|
|
418
|
+
|
|
419
|
+
## License
|
|
420
|
+
|
|
421
|
+
MIT
|