@umituz/react-native-settings 4.20.58 → 4.20.60
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/SettingsStackNavigator.tsx +2 -0
- package/src/presentation/navigation/components/README.md +70 -295
- package/src/presentation/navigation/components/wrappers/SettingsScreenWrapper.tsx +3 -0
- package/src/presentation/navigation/hooks/README.md +75 -367
- package/src/presentation/navigation/types.ts +1 -0
- package/src/presentation/navigation/utils/README.md +100 -380
- package/src/presentation/screens/README.md +53 -504
- package/src/presentation/screens/SettingsScreen.tsx +4 -2
- 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
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# SettingsItemCard
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Premium, consistent card component for displaying settings items with icons, text, and optional controls (switches, chevrons).
|
|
5
|
+
|
|
6
|
+
## File Path
|
|
7
|
+
`src/presentation/components/SettingsItemCard/SettingsItemCard.tsx`
|
|
8
|
+
|
|
9
|
+
## Imports
|
|
10
|
+
```typescript
|
|
11
|
+
import { SettingsItemCard } from '@umituz/react-native-settings';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Strategy
|
|
15
|
+
|
|
16
|
+
### When to Use
|
|
17
|
+
- Use for ALL settings list items
|
|
18
|
+
- Use when displaying navigation items
|
|
19
|
+
- Use for toggle/switch settings
|
|
20
|
+
- Use for any setting that requires user interaction
|
|
21
|
+
|
|
22
|
+
### Integration Pattern
|
|
23
|
+
1. Import from `@umituz/react-native-settings`
|
|
24
|
+
2. Reference the implementation file for current props
|
|
25
|
+
3. Check `SettingsItemCardProps` interface for available options
|
|
26
|
+
4. Use design system tokens for custom styling
|
|
27
|
+
|
|
28
|
+
### Best Practices
|
|
29
|
+
- Keep titles short and descriptive
|
|
30
|
+
- Use descriptions for additional context
|
|
31
|
+
- Provide press handlers for navigation
|
|
32
|
+
- Use switches for boolean toggles
|
|
33
|
+
- Show right icons for navigation hints
|
|
34
|
+
|
|
35
|
+
## Restrictions (Forbidden)
|
|
36
|
+
|
|
37
|
+
### ❌ DO NOT
|
|
38
|
+
- Create custom settings item components
|
|
39
|
+
- Inline settings item logic in screens
|
|
40
|
+
- Use TouchableOpacity directly for settings items
|
|
41
|
+
- Mix different settings item styles
|
|
42
|
+
- Hardcode colors or sizes
|
|
43
|
+
|
|
44
|
+
### ❌ NEVER
|
|
45
|
+
- Bypass SettingsItemCard for settings items
|
|
46
|
+
- Use different icon libraries
|
|
47
|
+
- Override internal styles directly
|
|
48
|
+
- Nest SettingsItemCard deeply
|
|
49
|
+
|
|
50
|
+
### ❌ AVOID
|
|
51
|
+
- Overloading with too many props
|
|
52
|
+
- Using without proper accessibility
|
|
53
|
+
- Creating variants outside the component
|
|
54
|
+
- Duplicating functionality
|
|
55
|
+
|
|
56
|
+
## Rules
|
|
57
|
+
|
|
58
|
+
### ✅ ALWAYS
|
|
59
|
+
- Use SettingsItemCard for all settings items
|
|
60
|
+
- Import from `@umituz/react-native-settings`
|
|
61
|
+
- Provide required props: `icon`, `title`
|
|
62
|
+
- Add `onPress` handler for interactive items
|
|
63
|
+
- Use proper icon names from Ionicons
|
|
64
|
+
- Include accessibility labels
|
|
65
|
+
|
|
66
|
+
### ✅ MUST
|
|
67
|
+
- Follow SettingsItemCardProps interface
|
|
68
|
+
- Use design system tokens for styling
|
|
69
|
+
- Handle press events appropriately
|
|
70
|
+
- Provide meaningful titles
|
|
71
|
+
- Support both light and dark themes
|
|
72
|
+
|
|
73
|
+
### ✅ SHOULD
|
|
74
|
+
- Use description/subtitle for context
|
|
75
|
+
- Show switches for boolean settings
|
|
76
|
+
- Display right icons for navigation
|
|
77
|
+
- Group related items in sections
|
|
78
|
+
- Test on both iOS and Android
|
|
79
|
+
|
|
80
|
+
## Props Reference
|
|
81
|
+
|
|
82
|
+
See implementation file for complete props:
|
|
83
|
+
`src/presentation/components/SettingsItemCard/SettingsItemCard.tsx`
|
|
84
|
+
|
|
85
|
+
Required props:
|
|
86
|
+
- `icon`: IconName from Ionicons
|
|
87
|
+
- `title`: string
|
|
88
|
+
|
|
89
|
+
Common optional props:
|
|
90
|
+
- `subtitle`/`description`: Additional text
|
|
91
|
+
- `onPress`: Press handler
|
|
92
|
+
- `showSwitch`: Boolean for toggle
|
|
93
|
+
- `switchValue`: Switch state
|
|
94
|
+
- `onSwitchChange`: Switch change handler
|
|
95
|
+
- `rightIcon`: Right-side icon
|
|
96
|
+
- `disabled`: Disable interaction
|
|
97
|
+
|
|
98
|
+
## Related Components
|
|
99
|
+
|
|
100
|
+
- **SettingsSection**: `src/presentation/screens/components/sections/SettingsSection/SettingsSection.tsx`
|
|
101
|
+
- Container for grouping SettingsItemCard components
|
|
102
|
+
|
|
103
|
+
- **SettingsContent**: `src/presentation/screens/components/SettingsContent/SettingsContent.tsx`
|
|
104
|
+
- Main content composer that uses SettingsItemCard
|
|
105
|
+
|
|
106
|
+
- **SettingsScreen**: `src/presentation/screens/SettingsScreen.tsx`
|
|
107
|
+
- Main screen that displays settings items
|
|
108
|
+
|
|
109
|
+
## AI Agent Guidelines
|
|
110
|
+
|
|
111
|
+
### When Generating SettingsItemCard Code
|
|
112
|
+
|
|
113
|
+
1. **Import Statement**
|
|
114
|
+
```typescript
|
|
115
|
+
import { SettingsItemCard } from '@umituz/react-native-settings';
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
2. **Required Props**
|
|
119
|
+
- Always provide `icon` (Ionicons name)
|
|
120
|
+
- Always provide `title` (string)
|
|
121
|
+
|
|
122
|
+
3. **Common Patterns**
|
|
123
|
+
- Navigation items: Add `onPress` and `rightIcon`
|
|
124
|
+
- Toggle items: Add `showSwitch`, `switchValue`, `onSwitchChange`
|
|
125
|
+
- Disabled items: Add `disabled={true}`
|
|
126
|
+
|
|
127
|
+
4. **What to Avoid**
|
|
128
|
+
- Don't create custom card components
|
|
129
|
+
- Don't wrap in unnecessary containers
|
|
130
|
+
- Don't hardcode colors
|
|
131
|
+
- Don't use inline styles
|
|
132
|
+
|
|
133
|
+
5. **File Reference**
|
|
134
|
+
- Check implementation: `src/presentation/components/SettingsItemCard/SettingsItemCard.tsx`
|
|
135
|
+
- Check props interface: `SettingsItemCardProps`
|
|
136
|
+
- Check styles: Look for design system tokens usage
|
|
137
|
+
|
|
138
|
+
6. **Consistency Rules**
|
|
139
|
+
- Use same icon style across app
|
|
140
|
+
- Keep titles concise (1-3 words)
|
|
141
|
+
- Use descriptions only when needed
|
|
142
|
+
- Group related items together
|
|
143
|
+
|
|
144
|
+
### Example Pattern (Conceptual)
|
|
145
|
+
|
|
146
|
+
Instead of code examples, follow this pattern:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Settings Item → SettingsItemCard
|
|
150
|
+
- Required: icon, title
|
|
151
|
+
- Navigation: onPress, rightIcon
|
|
152
|
+
- Toggle: showSwitch, switchValue, onSwitchChange
|
|
153
|
+
- Disabled: disabled={true}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Version Compatibility
|
|
157
|
+
|
|
158
|
+
- Minimum React Native version: 0.60.0
|
|
159
|
+
- Requires: @umituz/react-native-design-system
|
|
160
|
+
- Compatible with: React Navigation 6.x
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
MIT
|
|
@@ -1,421 +1,67 @@
|
|
|
1
1
|
# SettingsSection
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Grouping**: Groups related settings together
|
|
8
|
-
- **Headers**: Optional section titles with styling
|
|
9
|
-
- **Spacing**: Consistent spacing between sections
|
|
10
|
-
- **Customizable**: Custom styles and headers
|
|
11
|
-
- **Flexible**: Supports any content as children
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
This component is part of `@umituz/react-native-settings`.
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
### Basic Section
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { SettingsSection } from '@umituz/react-native-settings';
|
|
23
|
-
|
|
24
|
-
function GeneralSettings() {
|
|
25
|
-
return (
|
|
26
|
-
<SettingsSection title="GENERAL">
|
|
27
|
-
<SettingsItemCard
|
|
28
|
-
icon="person-outline"
|
|
29
|
-
title="Profile"
|
|
30
|
-
rightIcon="chevron-forward"
|
|
31
|
-
onPress={() => {}}
|
|
32
|
-
/>
|
|
33
|
-
<SettingsItemCard
|
|
34
|
-
icon="notifications-outline"
|
|
35
|
-
title="Notifications"
|
|
36
|
-
showSwitch={true}
|
|
37
|
-
switchValue={enabled}
|
|
38
|
-
onSwitchChange={setEnabled}
|
|
39
|
-
/>
|
|
40
|
-
</SettingsSection>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Without Title
|
|
46
|
-
|
|
47
|
-
```tsx
|
|
48
|
-
function UntitledSection() {
|
|
49
|
-
return (
|
|
50
|
-
<SettingsSection>
|
|
51
|
-
<SettingsItemCard
|
|
52
|
-
icon="settings-outline"
|
|
53
|
-
title="Settings"
|
|
54
|
-
onPress={() => {}}
|
|
55
|
-
/>
|
|
56
|
-
</SettingsSection>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### With Custom Style
|
|
62
|
-
|
|
63
|
-
```tsx
|
|
64
|
-
function StyledSection() {
|
|
65
|
-
return (
|
|
66
|
-
<SettingsSection
|
|
67
|
-
title="APPEARANCE"
|
|
68
|
-
style={{ backgroundColor: '#f5f5f5' }}
|
|
69
|
-
titleStyle={{ color: '#2196F3' }}
|
|
70
|
-
>
|
|
71
|
-
<SettingsItemCard
|
|
72
|
-
icon="moon-outline"
|
|
73
|
-
title="Dark Mode"
|
|
74
|
-
showSwitch={true}
|
|
75
|
-
switchValue={darkMode}
|
|
76
|
-
onSwitchChange={setDarkMode}
|
|
77
|
-
/>
|
|
78
|
-
</SettingsSection>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Props
|
|
84
|
-
|
|
85
|
-
### SettingsSectionProps
|
|
86
|
-
|
|
87
|
-
| Prop | Type | Default | Description |
|
|
88
|
-
|------|------|---------|-------------|
|
|
89
|
-
| `title` | `string` | `undefined` | Section title |
|
|
90
|
-
| `children` | `ReactNode` | **Required** | Section content |
|
|
91
|
-
| `style` | `ViewStyle` | `undefined` | Custom container style |
|
|
92
|
-
| `titleStyle` | `TextStyle` | `undefined` | Custom title style |
|
|
93
|
-
| `showTitle` | `boolean` | `true` | Show/hide title |
|
|
94
|
-
| `containerStyle` | `ViewStyle` | `undefined` | Content container style |
|
|
95
|
-
| `testID` | `string` | `undefined` | Test identifier |
|
|
96
|
-
|
|
97
|
-
## Component Structure
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
SettingsSection
|
|
101
|
-
├── Section Header (if title provided)
|
|
102
|
-
│ └── Title Text
|
|
103
|
-
└── Content Container
|
|
104
|
-
└── Children (SettingsItemCard components)
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Examples
|
|
108
|
-
|
|
109
|
-
### Multiple Sections
|
|
110
|
-
|
|
111
|
-
```tsx
|
|
112
|
-
function SettingsScreen() {
|
|
113
|
-
return (
|
|
114
|
-
<ScrollView>
|
|
115
|
-
<SettingsSection title="GENERAL">
|
|
116
|
-
<SettingsItemCard icon="person-outline" title="Profile" onPress={() => {}} />
|
|
117
|
-
<SettingsItemCard icon="notifications-outline" title="Notifications" onPress={() => {}} />
|
|
118
|
-
</SettingsSection>
|
|
119
|
-
|
|
120
|
-
<SettingsSection title="APPEARANCE">
|
|
121
|
-
<SettingsItemCard icon="moon-outline" title="Dark Mode" onPress={() => {}} />
|
|
122
|
-
<SettingsItemCard icon="color-palette-outline" title="Theme" onPress={() => {}} />
|
|
123
|
-
</SettingsSection>
|
|
124
|
-
|
|
125
|
-
<SettingsSection title="PRIVACY">
|
|
126
|
-
<SettingsItemCard icon="shield-outline" title="Privacy" onPress={() => {}} />
|
|
127
|
-
<SettingsItemCard icon="lock-closed-outline" title="Security" onPress={() => {}} />
|
|
128
|
-
</SettingsSection>
|
|
129
|
-
</ScrollView>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### With Header Customization
|
|
135
|
-
|
|
136
|
-
```tsx
|
|
137
|
-
function CustomHeaderSection() {
|
|
138
|
-
return (
|
|
139
|
-
<SettingsSection
|
|
140
|
-
title="PREFERENCES"
|
|
141
|
-
titleStyle={{
|
|
142
|
-
fontSize: 12,
|
|
143
|
-
fontWeight: '700',
|
|
144
|
-
color: '#2196F3',
|
|
145
|
-
letterSpacing: 1,
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
<SettingsItemCard
|
|
149
|
-
icon="globe-outline"
|
|
150
|
-
title="Language"
|
|
151
|
-
subtitle="English"
|
|
152
|
-
onPress={() => {}}
|
|
153
|
-
/>
|
|
154
|
-
</SettingsSection>
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
```
|
|
3
|
+
## Purpose
|
|
158
4
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
```tsx
|
|
162
|
-
function SpacedSection() {
|
|
163
|
-
return (
|
|
164
|
-
<SettingsSection
|
|
165
|
-
title="SETTINGS"
|
|
166
|
-
style={{ marginBottom: 20 }}
|
|
167
|
-
containerStyle={{ gap: 10 }}
|
|
168
|
-
>
|
|
169
|
-
<SettingsItemCard icon="cog-outline" title="Settings" onPress={() => {}} />
|
|
170
|
-
<SettingsItemCard icon="apps-outline" title="Apps" onPress={() => {}} />
|
|
171
|
-
</SettingsSection>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Nested Content
|
|
177
|
-
|
|
178
|
-
```tsx
|
|
179
|
-
function NestedContentSection() {
|
|
180
|
-
return (
|
|
181
|
-
<SettingsSection title="ADVANCED">
|
|
182
|
-
<View>
|
|
183
|
-
<Text style={styles.heading}>Display Options</Text>
|
|
184
|
-
<SettingsItemCard
|
|
185
|
-
icon="eye-outline"
|
|
186
|
-
title="Show Preview"
|
|
187
|
-
showSwitch={true}
|
|
188
|
-
switchValue={showPreview}
|
|
189
|
-
onSwitchChange={setShowPreview}
|
|
190
|
-
/>
|
|
191
|
-
</View>
|
|
192
|
-
|
|
193
|
-
<View>
|
|
194
|
-
<Text style={styles.heading}>Storage</Text>
|
|
195
|
-
<SettingsItemCard
|
|
196
|
-
icon="trash-outline"
|
|
197
|
-
title="Clear Cache"
|
|
198
|
-
onPress={() => {}}
|
|
199
|
-
/>
|
|
200
|
-
</View>
|
|
201
|
-
</SettingsSection>
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Conditional Items
|
|
207
|
-
|
|
208
|
-
```tsx
|
|
209
|
-
function ConditionalSection() {
|
|
210
|
-
const isPro = useIsProUser();
|
|
211
|
-
|
|
212
|
-
return (
|
|
213
|
-
<SettingsSection title="PREMIUM">
|
|
214
|
-
<SettingsItemCard
|
|
215
|
-
icon="star-outline"
|
|
216
|
-
title="Upgrade to Pro"
|
|
217
|
-
subtitle="Get all premium features"
|
|
218
|
-
onPress={() => {}}
|
|
219
|
-
/>
|
|
220
|
-
|
|
221
|
-
{isPro && (
|
|
222
|
-
<SettingsItemCard
|
|
223
|
-
icon="diamond-outline"
|
|
224
|
-
title="Pro Features"
|
|
225
|
-
subtitle="Manage your subscription"
|
|
226
|
-
onPress={() => {}}
|
|
227
|
-
/>
|
|
228
|
-
)}
|
|
229
|
-
|
|
230
|
-
{isPro && (
|
|
231
|
-
<SettingsItemCard
|
|
232
|
-
icon="card-outline"
|
|
233
|
-
title="Billing"
|
|
234
|
-
onPress={() => {}}
|
|
235
|
-
/>
|
|
236
|
-
)}
|
|
237
|
-
</SettingsSection>
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
## Styling
|
|
243
|
-
|
|
244
|
-
### Default Styles
|
|
245
|
-
|
|
246
|
-
```typescript
|
|
247
|
-
const styles = StyleSheet.create({
|
|
248
|
-
container: {
|
|
249
|
-
marginTop: tokens.spacing.lg,
|
|
250
|
-
},
|
|
251
|
-
title: {
|
|
252
|
-
fontSize: tokens.typography.fontSize.xs,
|
|
253
|
-
fontWeight: '700',
|
|
254
|
-
color: tokens.colors.textSecondary,
|
|
255
|
-
textTransform: 'uppercase',
|
|
256
|
-
letterSpacing: 0.5,
|
|
257
|
-
marginLeft: tokens.spacing.xl,
|
|
258
|
-
marginBottom: tokens.spacing.sm,
|
|
259
|
-
},
|
|
260
|
-
content: {
|
|
261
|
-
// No additional styling by default
|
|
262
|
-
},
|
|
263
|
-
});
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
### Custom Section Styles
|
|
267
|
-
|
|
268
|
-
```tsx
|
|
269
|
-
<SettingsSection
|
|
270
|
-
title="CUSTOM"
|
|
271
|
-
style={{
|
|
272
|
-
backgroundColor: '#fff',
|
|
273
|
-
padding: 10,
|
|
274
|
-
borderRadius: 10,
|
|
275
|
-
margin: 15,
|
|
276
|
-
}}
|
|
277
|
-
titleStyle={{
|
|
278
|
-
color: '#FF5722',
|
|
279
|
-
fontSize: 14,
|
|
280
|
-
fontWeight: 'bold',
|
|
281
|
-
}}
|
|
282
|
-
>
|
|
283
|
-
{/* Content */}
|
|
284
|
-
</SettingsSection>
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### Section Variants
|
|
288
|
-
|
|
289
|
-
#### Compact Section
|
|
290
|
-
|
|
291
|
-
```tsx
|
|
292
|
-
<SettingsSection
|
|
293
|
-
title="QUICK SETTINGS"
|
|
294
|
-
style={{ marginTop: tokens.spacing.sm }}
|
|
295
|
-
>
|
|
296
|
-
{/* Items */}
|
|
297
|
-
</SettingsSection>
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
#### Spaced Section
|
|
301
|
-
|
|
302
|
-
```tsx
|
|
303
|
-
<SettingsSection
|
|
304
|
-
title="SETTINGS"
|
|
305
|
-
style={{ marginTop: tokens.spacing.xl }}
|
|
306
|
-
>
|
|
307
|
-
{/* Items */}
|
|
308
|
-
</SettingsSection>
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
#### Full Width Section
|
|
312
|
-
|
|
313
|
-
```tsx
|
|
314
|
-
<SettingsSection
|
|
315
|
-
title="FULL WIDTH"
|
|
316
|
-
style={{ marginHorizontal: 0 }}
|
|
317
|
-
titleStyle={{ marginLeft: tokens.spacing.lg }}
|
|
318
|
-
>
|
|
319
|
-
{/* Items */}
|
|
320
|
-
</SettingsSection>
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
## Layout Integration
|
|
5
|
+
Container component for grouping related settings items with section headers and consistent styling.
|
|
324
6
|
|
|
325
|
-
|
|
7
|
+
## File Paths
|
|
326
8
|
|
|
327
|
-
|
|
328
|
-
function SettingsScreen() {
|
|
329
|
-
return (
|
|
330
|
-
<ScrollView style={styles.scrollView}>
|
|
331
|
-
<SettingsSection title="GENERAL">
|
|
332
|
-
<SettingsItemCard icon="person-outline" title="Profile" onPress={() => {}} />
|
|
333
|
-
<SettingsItemCard icon="notifications-outline" title="Notifications" onPress={() => {}} />
|
|
334
|
-
</SettingsSection>
|
|
9
|
+
- **Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/components/SettingsSection/SettingsSection.tsx`
|
|
335
10
|
|
|
336
|
-
|
|
337
|
-
<SettingsItemCard icon="moon-outline" title="Dark Mode" onPress={() => {}} />
|
|
338
|
-
</SettingsSection>
|
|
339
|
-
</ScrollView>
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
```
|
|
11
|
+
## Strategy
|
|
343
12
|
|
|
344
|
-
|
|
13
|
+
1. **Logical Grouping**: Groups related settings together under section headers for better organization and user experience
|
|
14
|
+
2. **Flexible Layout**: Supports any content as children, allowing for dynamic settings items
|
|
15
|
+
3. **Consistent Spacing**: Uses design system tokens to maintain uniform spacing between sections
|
|
16
|
+
4. **Optional Headers**: Section titles are optional, allowing for unlabeled groups when needed
|
|
17
|
+
5. **Customizable Styling**: Supports custom styles for both container and title to match design requirements
|
|
345
18
|
|
|
346
|
-
|
|
347
|
-
function SettingsScreen() {
|
|
348
|
-
const sections = [
|
|
349
|
-
{
|
|
350
|
-
title: 'GENERAL',
|
|
351
|
-
data: [
|
|
352
|
-
{ id: '1', title: 'Profile', icon: 'person-outline' },
|
|
353
|
-
{ id: '2', title: 'Notifications', icon: 'notifications-outline' },
|
|
354
|
-
],
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
title: 'APPEARANCE',
|
|
358
|
-
data: [
|
|
359
|
-
{ id: '3', title: 'Dark Mode', icon: 'moon-outline' },
|
|
360
|
-
],
|
|
361
|
-
},
|
|
362
|
-
];
|
|
19
|
+
## Restrictions (Forbidden)
|
|
363
20
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
key={item.id}
|
|
369
|
-
icon={item.icon}
|
|
370
|
-
title={item.title}
|
|
371
|
-
onPress={() => {}}
|
|
372
|
-
/>
|
|
373
|
-
))}
|
|
374
|
-
</SettingsSection>
|
|
375
|
-
);
|
|
21
|
+
### DO NOT
|
|
22
|
+
- ❌ DO NOT nest SettingsSection components deeply (maximum 2 levels recommended)
|
|
23
|
+
- ❌ DO NOT mix different types of content unpredictably within sections
|
|
24
|
+
- ❌ DO NOT use hardcoded spacing values instead of design system tokens
|
|
376
25
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
keyExtractor={(item) => item.id}
|
|
382
|
-
/>
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
```
|
|
26
|
+
### NEVER
|
|
27
|
+
- ❌ NEVER use SettingsSection for non-settings content (e.g., forms, data displays)
|
|
28
|
+
- ❌ NEVER override critical accessibility properties
|
|
29
|
+
- ❌ NEVER use section titles that are misleading or unclear
|
|
386
30
|
|
|
387
|
-
|
|
31
|
+
### AVOID
|
|
32
|
+
- ❌ AVOID creating sections with only one item (consider placing in another section)
|
|
33
|
+
- ❌ AVOID using overly long section titles (keep under 25 characters)
|
|
34
|
+
- ❌ AVOID inconsistent section ordering across different screens
|
|
388
35
|
|
|
389
|
-
|
|
390
|
-
2. **Clear Titles**: Use descriptive, concise section titles
|
|
391
|
-
3. **Consistent Spacing**: Maintain consistent spacing between sections
|
|
392
|
-
4. **Order**: Order sections by importance or frequency of use
|
|
393
|
-
5. **Limit Items**: Keep sections focused (3-6 items max)
|
|
394
|
-
6. **Accessibility**: Ensure sections are accessible
|
|
395
|
-
7. **Styling**: Use design system tokens for consistency
|
|
36
|
+
## Rules (Mandatory)
|
|
396
37
|
|
|
397
|
-
|
|
38
|
+
### ALWAYS
|
|
39
|
+
- ✅ ALWAYS use design system tokens for spacing and styling
|
|
40
|
+
- ✅ ALWAYS provide clear, concise section titles in uppercase
|
|
41
|
+
- ✅ ALWAYS maintain consistent spacing between sections using tokens
|
|
42
|
+
- ✅ ALWAYS test section appearance in both light and dark themes
|
|
398
43
|
|
|
399
|
-
###
|
|
44
|
+
### MUST
|
|
45
|
+
- ✅ MUST group related settings logically (e.g., all notification settings together)
|
|
46
|
+
- ✅ MUST ensure section titles are descriptive and accurate
|
|
47
|
+
- ✅ MUST keep sections focused (3-6 items maximum recommended)
|
|
400
48
|
|
|
401
|
-
|
|
402
|
-
- ✅
|
|
403
|
-
- ✅
|
|
404
|
-
- ✅
|
|
49
|
+
### SHOULD
|
|
50
|
+
- ✅ SHOULD order sections by importance or frequency of use
|
|
51
|
+
- ✅ SHOULD use section titles that follow the pattern: [CATEGORY] or [FEATURE GROUP]
|
|
52
|
+
- ✅ SHOULD consider internationalization for section titles
|
|
405
53
|
|
|
406
|
-
|
|
54
|
+
## AI Agent Guidelines
|
|
407
55
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
56
|
+
1. **File Reference**: When modifying section layout, refer to `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/components/SettingsSection/SettingsSection.tsx`
|
|
57
|
+
2. **Design Tokens**: All spacing and styling must use tokens from the design system (e.g., `tokens.spacing.lg`, `tokens.colors.textSecondary`)
|
|
58
|
+
3. **Component Integration**: SettingsSection is designed to work with SettingsItemCard components as children
|
|
59
|
+
4. **Accessibility**: Ensure sections are properly labeled for screen readers
|
|
60
|
+
5. **Performance**: Avoid unnecessary re-renders by keeping section configuration stable
|
|
412
61
|
|
|
413
|
-
##
|
|
62
|
+
## Component Reference
|
|
414
63
|
|
|
415
|
-
|
|
416
|
-
- **
|
|
64
|
+
Related components:
|
|
65
|
+
- **SettingsItemCard**: Individual item component to be used inside sections
|
|
66
|
+
- **SettingsContent**: Content composer that manages multiple sections
|
|
417
67
|
- **SettingsScreen**: Main screen component
|
|
418
|
-
|
|
419
|
-
## License
|
|
420
|
-
|
|
421
|
-
MIT
|