@umituz/react-native-subscription 2.14.99 → 2.14.100

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 (92) hide show
  1. package/README.md +211 -394
  2. package/package.json +1 -1
  3. package/src/application/README.md +46 -225
  4. package/src/application/ports/README.md +42 -97
  5. package/src/domain/README.md +36 -384
  6. package/src/domain/constants/README.md +0 -56
  7. package/src/domain/entities/README.md +43 -169
  8. package/src/domain/errors/README.md +33 -287
  9. package/src/domain/value-objects/README.md +43 -179
  10. package/src/domains/README.md +50 -238
  11. package/src/domains/README.md.bak +274 -0
  12. package/src/domains/config/README.md +93 -383
  13. package/src/domains/config/domain/README.md +23 -376
  14. package/src/domains/config/domain/entities/README.md +34 -343
  15. package/src/domains/paywall/README.md +99 -369
  16. package/src/domains/paywall/components/README.md +34 -178
  17. package/src/domains/paywall/entities/README.md +34 -193
  18. package/src/domains/paywall/hooks/README.md +34 -122
  19. package/src/domains/wallet/README.md +34 -275
  20. package/src/domains/wallet/README.md.bak +209 -0
  21. package/src/domains/wallet/domain/README.md +34 -101
  22. package/src/domains/wallet/domain/entities/README.md +34 -115
  23. package/src/domains/wallet/domain/errors/README.md +34 -151
  24. package/src/domains/wallet/infrastructure/README.md +34 -89
  25. package/src/domains/wallet/presentation/components/README.md +34 -224
  26. package/src/domains/wallet/presentation/hooks/README.md +34 -248
  27. package/src/infrastructure/README.md +37 -496
  28. package/src/infrastructure/mappers/README.md +0 -13
  29. package/src/infrastructure/repositories/README.md +74 -360
  30. package/src/infrastructure/services/README.md +95 -370
  31. package/src/presentation/README.md +123 -408
  32. package/src/presentation/README.md.bak +172 -0
  33. package/src/presentation/components/README.md +151 -179
  34. package/src/presentation/components/README.md.bak +217 -0
  35. package/src/presentation/components/details/CreditRow.md +65 -310
  36. package/src/presentation/components/details/DetailRow.md +63 -255
  37. package/src/presentation/components/details/PremiumDetailsCard.md +65 -238
  38. package/src/presentation/components/details/PremiumStatusBadge.md +64 -239
  39. package/src/presentation/components/details/README.md +97 -447
  40. package/src/presentation/components/feedback/PaywallFeedbackModal.md +63 -287
  41. package/src/presentation/components/feedback/README.md +97 -445
  42. package/src/presentation/components/paywall/PaywallModal.md +66 -416
  43. package/src/presentation/components/paywall/README.md +50 -186
  44. package/src/presentation/components/sections/README.md +97 -466
  45. package/src/presentation/components/sections/SubscriptionSection.md +92 -244
  46. package/src/presentation/hooks/README.md +154 -741
  47. package/src/presentation/hooks/useAuthAwarePurchase.md +58 -325
  48. package/src/presentation/hooks/useAuthGate.md +61 -375
  49. package/src/presentation/hooks/useAuthSubscriptionSync.md +66 -370
  50. package/src/presentation/hooks/useCreditChecker.md +73 -378
  51. package/src/presentation/hooks/useCredits.md +74 -313
  52. package/src/presentation/hooks/useCredits.md.bak +231 -0
  53. package/src/presentation/hooks/useCreditsGate.md +66 -318
  54. package/src/presentation/hooks/useDeductCredit.md +0 -76
  55. package/src/presentation/hooks/useDevTestCallbacks.md +63 -394
  56. package/src/presentation/hooks/useFeatureGate.md +105 -150
  57. package/src/presentation/hooks/useFeatureGate.md.bak +284 -0
  58. package/src/presentation/hooks/useInitializeCredits.md +64 -430
  59. package/src/presentation/hooks/usePaywall.md +61 -306
  60. package/src/presentation/hooks/usePaywallOperations.md +64 -458
  61. package/src/presentation/hooks/usePaywallVisibility.md +67 -316
  62. package/src/presentation/hooks/usePremium.md +84 -226
  63. package/src/presentation/hooks/usePremiumGate.md +60 -395
  64. package/src/presentation/hooks/usePremiumWithCredits.md +64 -401
  65. package/src/presentation/hooks/useSubscription.md +66 -422
  66. package/src/presentation/hooks/useSubscriptionDetails.md +65 -410
  67. package/src/presentation/hooks/useSubscriptionGate.md +80 -164
  68. package/src/presentation/hooks/useSubscriptionSettingsConfig.md +66 -346
  69. package/src/presentation/hooks/useSubscriptionStatus.md +66 -396
  70. package/src/presentation/hooks/useUserTier.md +63 -328
  71. package/src/presentation/hooks/useUserTierWithRepository.md +64 -424
  72. package/src/presentation/screens/README.md +48 -190
  73. package/src/presentation/types/README.md +0 -16
  74. package/src/presentation/utils/README.md +0 -21
  75. package/src/revenuecat/README.md +99 -518
  76. package/src/revenuecat/application/README.md +35 -150
  77. package/src/revenuecat/application/ports/README.md +34 -162
  78. package/src/revenuecat/domain/README.md +42 -141
  79. package/src/revenuecat/domain/constants/README.md +34 -176
  80. package/src/revenuecat/domain/entities/README.md +34 -374
  81. package/src/revenuecat/domain/errors/README.md +47 -191
  82. package/src/revenuecat/domain/types/README.md +34 -366
  83. package/src/revenuecat/domain/value-objects/README.md +34 -434
  84. package/src/revenuecat/infrastructure/README.md +34 -43
  85. package/src/revenuecat/infrastructure/config/README.md +32 -23
  86. package/src/revenuecat/infrastructure/handlers/README.md +34 -211
  87. package/src/revenuecat/infrastructure/managers/README.md +34 -42
  88. package/src/revenuecat/infrastructure/services/README.md +35 -318
  89. package/src/revenuecat/infrastructure/utils/README.md +34 -375
  90. package/src/revenuecat/presentation/README.md +34 -176
  91. package/src/revenuecat/presentation/hooks/README.md +29 -35
  92. package/src/utils/README.md +38 -525
@@ -2,282 +2,90 @@
2
2
 
3
3
  Simple row component displaying a label-value pair for subscription details.
4
4
 
5
- ## Import
5
+ ## Location
6
6
 
7
- ```typescript
8
- import { DetailRow } from '@umituz/react-native-subscription';
9
- ```
7
+ **Import Path**: `@umituz/react-native-subscription`
10
8
 
11
- ## Signature
9
+ **File**: `src/presentation/components/details/DetailRow.tsx`
12
10
 
13
- ```typescript
14
- interface DetailRowProps {
15
- label: string;
16
- value: string;
17
- highlight?: boolean;
18
- style?: ViewStyle;
19
- labelStyle?: TextStyle;
20
- valueStyle?: TextStyle;
21
- }
22
- ```
11
+ **Type**: Component
23
12
 
24
- ## Props
13
+ ## Strategy
25
14
 
26
- | Prop | Type | Default | Description |
27
- |------|------|---------|-------------|
28
- | `label` | `string` | **Required** | Row label (left side) |
29
- | `value` | `string` | **Required** | Row value (right side) |
30
- | `highlight` | `boolean` | `false` | Highlight value in warning color |
31
- | `style` | `ViewStyle` | `undefined` | Container style override |
32
- | `labelStyle` | `TextStyle` | `undefined` | Label text style override |
33
- | `valueStyle` | `TextStyle` | `undefined` | Value text style override |
15
+ ### Label-Value Display
34
16
 
35
- ## Basic Usage
17
+ 1. **Label Positioning**: Display label on left side
18
+ 2. **Value Positioning**: Display value on right side
19
+ 3. **Space Distribution**: Even spacing between label and value
20
+ 4. **Highlight Option**: Support highlighting values (e.g., expiration warnings)
21
+ 5. **Custom Styling**: Allow style overrides for flexibility
22
+ 6. **Consistent Layout**: Maintain consistent vertical spacing
36
23
 
37
- ```typescript
38
- function SubscriptionDetails() {
39
- return (
40
- <View>
41
- <DetailRow
42
- label="Status"
43
- value="Active"
44
- />
45
- <DetailRow
46
- label="Expires"
47
- value="January 15, 2025"
48
- />
49
- <DetailRow
50
- label="Purchased"
51
- value="January 15, 2024"
52
- />
53
- </View>
54
- );
55
- }
56
- ```
24
+ ### Integration Points
57
25
 
58
- ## Advanced Usage
26
+ - **PremiumDetailsCard**: Uses this component internally
27
+ - **SubscriptionSection**: For subscription detail display
28
+ - **Settings Screens**: For settings detail items
29
+ - **List Components**: For detail lists
59
30
 
60
- ### With Highlight
31
+ ## Restrictions
61
32
 
62
- ```typescript
63
- function ExpiringSoonRow() {
64
- const daysRemaining = 3;
33
+ ### REQUIRED
65
34
 
66
- return (
67
- <DetailRow
68
- label="Expires"
69
- value={expirationDate.toLocaleDateString()}
70
- highlight={daysRemaining <= 7} // Highlight if expiring soon
71
- />
72
- );
73
- }
74
- ```
35
+ - **Label Prop**: MUST provide valid label string
36
+ - **Value Prop**: MUST provide valid value string
37
+ - **Spacing**: MUST maintain consistent spacing
38
+ - **Null Handling**: MUST handle null or undefined values
75
39
 
76
- ### With Custom Styling
40
+ ### PROHIBITED
77
41
 
78
- ```typescript
79
- function CustomDetailRow() {
80
- return (
81
- <DetailRow
82
- label="Subscription Type"
83
- value="Premium Yearly"
84
- style={{
85
- paddingVertical: 12,
86
- paddingHorizontal: 16,
87
- backgroundColor: '#F5F5F5',
88
- }}
89
- labelStyle={{
90
- fontWeight: '600',
91
- color: '#333',
92
- }}
93
- valueStyle={{
94
- fontWeight: '700',
95
- color: '#4CAF50',
96
- }}
97
- />
98
- );
99
- }
100
- ```
42
+ - **NEVER** display without label and value
43
+ - **NEVER** use highlight for non-warning cases
44
+ - **DO NOT** use excessively long labels (affects layout)
45
+ - **DO NOT** mix different data types in same list
101
46
 
102
- ### In Subscription Card
47
+ ### CRITICAL SAFETY
103
48
 
104
- ```typescript
105
- function SubscriptionCard() {
106
- const { status, expirationDate, willRenew } = useSubscriptionStatus();
49
+ - **ALWAYS** validate label and value props
50
+ - **MUST** handle empty strings
51
+ - **ALWAYS** use highlight sparingly (for warnings only)
52
+ - **NEVER** expose sensitive raw data
107
53
 
108
- return (
109
- <Card>
110
- <DetailRow
111
- label="Status"
112
- value={status.isActive ? 'Active' : 'Inactive'}
113
- />
54
+ ## AI Agent Guidelines
114
55
 
115
- {expirationDate && (
116
- <DetailRow
117
- label="Expires"
118
- value={expirationDate.toLocaleDateString()}
119
- highlight={!willRenew}
120
- />
121
- )}
56
+ ### When Implementing Detail Rows
122
57
 
123
- <DetailRow
124
- label="Auto-renew"
125
- value={willRenew ? 'Enabled' : 'Disabled'}
126
- />
127
- </Card>
128
- );
129
- }
130
- ```
58
+ 1. **Always** provide clear, concise labels
59
+ 2. **Always** format values appropriately
60
+ 3. **Always** use highlight only for warnings
61
+ 4. **Always** keep labels short and consistent
62
+ 5. **Never** display implementation details
131
63
 
132
- ## Color Options
64
+ ### Integration Checklist
133
65
 
134
- ### Default Colors
66
+ - [ ] Import from correct path: `@umituz/react-native-subscription`
67
+ - [ ] Provide valid label prop
68
+ - [ ] Provide valid value prop
69
+ - [ ] Format values appropriately
70
+ - [ ] Use highlight for warnings only
71
+ - [ ] Apply custom styling if needed
72
+ - [ ] Test with short values
73
+ - [ ] Test with long values
74
+ - [ ] Test with highlight enabled
75
+ - [ ] Test in list context
76
+ - [ ] Test standalone display
135
77
 
136
- ```typescript
137
- // Label color (left side)
138
- labelStyle = {
139
- color: tokens.colors.textSecondary, // Gray
140
- }
78
+ ### Common Patterns
141
79
 
142
- // Value color (right side)
143
- valueStyle = {
144
- color: tokens.colors.textPrimary, // Black
145
- fontWeight: '500',
146
- }
147
- ```
80
+ 1. **Subscription Details**: Show subscription info
81
+ 2. **Settings Items**: Display settings values
82
+ 3. **Status Information**: Show various status types
83
+ 4. **Date Display**: Format and show dates
84
+ 5. **Compact Lists**: Display multiple details
148
85
 
149
- ### Highlight Colors
86
+ ## Related Documentation
150
87
 
151
- ```typescript
152
- // When highlight={true}
153
- valueStyle = {
154
- color: tokens.colors.warning, // Orange/Yellow
155
- fontWeight: '500',
156
- }
157
- ```
158
-
159
- ## Examples
160
-
161
- ### Subscription Info List
162
-
163
- ```typescript
164
- function SubscriptionInfo() {
165
- const { status, expirationDate, purchaseDate, isLifetime } = useSubscriptionDetails();
166
-
167
- return (
168
- <View style={styles.section}>
169
- <Text style={styles.title}>Subscription Details</Text>
170
-
171
- <DetailRow
172
- label="Plan"
173
- value={status.productId || 'Free'}
174
- />
175
-
176
- {status.isActive && !isLifetime && (
177
- <>
178
- {expirationDate && (
179
- <DetailRow
180
- label="Expires"
181
- value={expirationDate.toLocaleDateString()}
182
- highlight={true}
183
- />
184
- )}
185
-
186
- {purchaseDate && (
187
- <DetailRow
188
- label="Purchased"
189
- value={purchaseDate.toLocaleDateString()}
190
- />
191
- )}
192
- </>
193
- )}
194
-
195
- {isLifetime && (
196
- <DetailRow
197
- label="Type"
198
- value="Lifetime Access"
199
- />
200
- )}
201
- </View>
202
- );
203
- }
204
- ```
205
-
206
- ### With Icons
207
-
208
- ```typescript
209
- function IconDetailRow() {
210
- return (
211
- <View style={styles.row}>
212
- <Icon name="calendar" size={20} color="#666" />
213
-
214
- <DetailRow
215
- label="Expiration"
216
- value="December 31, 2025"
217
- style={{ flex: 1, marginLeft: 8 }}
218
- />
219
- </View>
220
- );
221
- }
222
- ```
223
-
224
- ### Compact Layout
225
-
226
- ```typescript
227
- function CompactDetails() {
228
- return (
229
- <View>
230
- <DetailRow
231
- label="Price"
232
- value="$9.99/month"
233
- style={{ paddingVertical: 4 }}
234
- />
235
- <DetailRow
236
- label="Duration"
237
- value="Monthly"
238
- style={{ paddingVertical: 4 }}
239
- />
240
- <DetailRow
241
- label="Features"
242
- value="Unlimited access"
243
- style={{ paddingVertical: 4 }}
244
- />
245
- </View>
246
- );
247
- }
248
- ```
249
-
250
- ## Best Practices
251
-
252
- 1. **Use consistent labels** - Keep labels similar across screens
253
- 2. **Format values** - Ensure proper date/currency formatting
254
- 3. **Highlight wisely** - Only highlight important warnings
255
- 4. **Keep concise** - Don't make values too long
256
- 5. **Test layouts** - Verify display with different content lengths
257
- 6. **Localize labels** - Translate labels for i18n
258
- 7. **Match design system** - Use consistent spacing and colors
259
-
260
- ## Styling
261
-
262
- ```typescript
263
- const styles = StyleSheet.create({
264
- container: {
265
- flexDirection: 'row',
266
- justifyContent: 'space-between',
267
- alignItems: 'center',
268
- // Add vertical padding for spacing between rows
269
- paddingVertical: 8,
270
- },
271
- });
272
- ```
273
-
274
- ## Related Components
275
-
276
- - **PremiumDetailsCard** - Uses this component internally
277
- - **CreditRow** - Similar component for credit display
278
- - **SubscriptionSection** - Section containing detail rows
279
-
280
- ## See Also
281
-
282
- - [Subscription Details](../../hooks/useSubscriptionDetails.md)
283
- - [Status Display](../../hooks/useSubscriptionStatus.md)
88
+ - **PremiumDetailsCard**: Uses this component
89
+ - **CreditRow**: Similar component for credits
90
+ - **SubscriptionSection**: Section containing detail rows
91
+ - **Details README**: `./README.md`
@@ -2,265 +2,92 @@
2
2
 
3
3
  Premium subscription details card component.
4
4
 
5
- ## Import
5
+ ## Location
6
6
 
7
- ```typescript
8
- import { PremiumDetailsCard } from '@umituz/react-native-subscription';
9
- ```
7
+ **Import Path**: `@umituz/react-native-subscription`
10
8
 
11
- ## Props
9
+ **File**: `src/presentation/components/details/PremiumDetailsCard.tsx`
12
10
 
13
- ```typescript
14
- interface PremiumDetailsCardProps {
15
- status: SubscriptionStatus;
16
- onUpgradePress?: () => void;
17
- onManagePress?: () => void;
18
- style?: ViewStyle;
19
- translations?: PremiumDetailsCardTranslations;
20
- }
21
- ```
11
+ **Type**: Component
22
12
 
23
- ## Props Reference
13
+ ## Strategy
24
14
 
25
- | Property | Type | Required | Description |
26
- |----------|------|----------|-------------|
27
- | `status` | `SubscriptionStatus` | Yes | Subscription status object |
28
- | `onUpgradePress` | `() => void` | No | Callback when upgrade button pressed |
29
- | `onManagePress` | `() => void` | No | Callback when manage button pressed |
30
- | `style` | `ViewStyle` | No | Custom container style |
31
- | `translations` | `PremiumDetailsCardTranslations` | No | Custom translations |
15
+ ### Premium Status Card Display
32
16
 
33
- ## Basic Usage
17
+ 1. **Status Display**: Show premium status with badge
18
+ 2. **Detail Rendering**: Display subscription details (expiration, renewal, etc.)
19
+ 3. **Action Buttons**: Show manage or upgrade button based on status
20
+ 4. **Translation Support**: Support custom translations
21
+ 5. **Visual Hierarchy**: Clear structure with header, details, and actions
22
+ 6. **Responsive Design**: Adapt to different screen sizes
34
23
 
35
- ```typescript
36
- function MyScreen() {
37
- const { subscription } = usePremium();
24
+ ### Integration Points
38
25
 
39
- return (
40
- <PremiumDetailsCard
41
- status={subscription}
42
- onUpgradePress={() => console.log('Upgrade')}
43
- onManagePress={() => console.log('Manage')}
44
- />
45
- );
46
- }
47
- ```
26
+ - **useSubscriptionStatus**: For subscription status data
27
+ - **DetailRow**: For displaying individual details
28
+ - **PremiumStatusBadge**: For status badge
29
+ - **usePremium**: For premium status check
30
+ - **Navigation**: For button actions
48
31
 
49
- ## Examples
32
+ ## Restrictions
50
33
 
51
- ### With Custom Translations
34
+ ### REQUIRED
52
35
 
53
- ```typescript
54
- <PremiumDetailsCard
55
- status={subscription}
56
- translations={{
57
- title: 'Premium',
58
- active: 'Aktif',
59
- inactive: 'Aktif Değil',
60
- expires: 'Son Kullanma',
61
- renews: 'Yenileniyor',
62
- manage: 'Yönet',
63
- upgrade: 'Yükselt',
64
- lifetime: 'Ömür Boyu',
65
- }}
66
- />
67
- ```
36
+ - **Status Prop**: MUST provide valid subscription status object
37
+ - **Callback Handling**: MUST implement button callbacks
38
+ - **Loading State**: MUST handle loading state
39
+ - **Null Handling**: MUST handle null status values
68
40
 
69
- ### With Custom Styling
41
+ ### PROHIBITED
70
42
 
71
- ```typescript
72
- const customStyles = StyleSheet.create({
73
- card: {
74
- backgroundColor: '#FF6B6B',
75
- borderRadius: 16,
76
- padding: 20,
77
- },
78
- title: {
79
- color: '#fff',
80
- fontSize: 24,
81
- },
82
- });
43
+ - **NEVER** display without status data
44
+ - **NEVER** hardcode status text (use translations)
45
+ - **DO NOT** show both manage and upgrade buttons
46
+ - **DO NOT** expose sensitive implementation details
83
47
 
84
- <PremiumDetailsCard
85
- status={subscription}
86
- style={customStyles.card}
87
- titleStyle={customStyles.title}
88
- />
89
- ```
48
+ ### CRITICAL SAFETY
90
49
 
91
- ### Without Buttons
50
+ - **ALWAYS** validate status object
51
+ - **MUST** handle loading state
52
+ - **ALWAYS** provide clear button labels
53
+ - **NEVER** trust client-side status for security
92
54
 
93
- ```typescript
94
- <PremiumDetailsCard
95
- status={subscription}
96
- showManageButton={false}
97
- showUpgradeButton={false}
98
- />
99
- ```
55
+ ## AI Agent Guidelines
100
56
 
101
- ## Translations Interface
57
+ ### When Implementing Premium Cards
102
58
 
103
- ```typescript
104
- interface PremiumDetailsCardTranslations {
105
- title?: string; // 'Premium'
106
- status?: string; // 'Active' or 'Inactive'
107
- expires?: string; // 'Expires on'
108
- renews?: string; // 'Renews on'
109
- manage?: string; // 'Manage Subscription'
110
- upgrade?: string; // 'Upgrade to Premium'
111
- lifetime?: string; // 'Lifetime Access'
112
- }
113
- ```
59
+ 1. **Always** provide valid subscription status
60
+ 2. **Always** handle loading state
61
+ 3. **Always** implement button callbacks
62
+ 4. **Always** use translations for localization
63
+ 5. **Never** hardcode status strings
114
64
 
115
- ## Component Structure
65
+ ### Integration Checklist
116
66
 
117
- ```
118
- PremiumDetailsCard
119
- ├── Container
120
- │ ├── Header
121
- │ │ ├── Title (Premium Badge)
122
- │ │ └── Status (Active/Inactive)
123
- │ ├── Details
124
- │ │ ├── Expiration Date
125
- │ │ ├── Renewal Status
126
- │ │ └── Product Info
127
- │ └── Footer
128
- │ ├── Manage Button (if premium)
129
- │ └── Upgrade Button (if free)
130
- ```
67
+ - [ ] Import from correct path: `@umituz/react-native-subscription`
68
+ - [ ] Provide valid subscription status
69
+ - [ ] Implement onManagePress callback
70
+ - [ ] Implement onUpgradePress callback
71
+ - [ ] Handle loading state
72
+ - [ ] Handle null dates
73
+ - [ ] Provide translations
74
+ - [ ] Test with active premium
75
+ - [ ] Test with expired subscription
76
+ - [ ] Test with free user
77
+ - [ ] Test with lifetime subscription
131
78
 
132
- ## Styling
79
+ ### Common Patterns
133
80
 
134
- ### Default Styles
81
+ 1. **Profile Display**: Show in user profile
82
+ 2. **Settings Card**: Display in settings screen
83
+ 3. **Status Overview**: Show premium status overview
84
+ 4. **With Navigation**: Navigate to management
85
+ 5. **Localized Display**: Use with i18n
135
86
 
136
- ```typescript
137
- const defaultStyles = StyleSheet.create({
138
- container: {
139
- backgroundColor: '#fff',
140
- borderRadius: 12,
141
- padding: 16,
142
- margin: 16,
143
- shadowColor: '#000',
144
- shadowOffset: { width: 0, height: 2 },
145
- shadowOpacity: 0.1,
146
- shadowRadius: 4,
147
- elevation: 3,
148
- },
149
- header: {
150
- flexDirection: 'row',
151
- alignItems: 'center',
152
- marginBottom: 12,
153
- },
154
- title: {
155
- fontSize: 20,
156
- fontWeight: 'bold',
157
- color: '#000',
158
- },
159
- badge: {
160
- backgroundColor: '#FFD700',
161
- paddingHorizontal: 8,
162
- paddingVertical: 4,
163
- borderRadius: 12,
164
- },
165
- });
166
- ```
87
+ ## Related Documentation
167
88
 
168
- ### Theme Customization
169
-
170
- ```typescript
171
- const darkTheme = {
172
- container: {
173
- backgroundColor: '#1a1a1a',
174
- },
175
- title: {
176
- color: '#fff',
177
- },
178
- text: {
179
- color: '#ccc',
180
- },
181
- };
182
-
183
- <PremiumDetailsCard
184
- status={subscription}
185
- theme={darkTheme}
186
- />
187
- ```
188
-
189
- ## Accessibility
190
-
191
- The component includes:
192
-
193
- - ✅ Accessibility label
194
- - ✅ Accessibility hint
195
- - ✅ Screen reader support
196
- - ✅ Minimum touch target size (44x44)
197
-
198
- ```typescript
199
- <PremiumDetailsCard
200
- status={subscription}
201
- accessibilityLabel="Premium subscription details"
202
- accessibilityHint="Shows your premium subscription status and options"
203
- />
204
- ```
205
-
206
- ## Best Practices
207
-
208
- 1. **Provide callbacks** - Always handle upgrade/manage presses
209
- 2. **Show for premium users** - Display current subscription info
210
- 3. **Show for free users** - Encourage upgrade
211
- 4. **Update on purchase** - Refetch after subscription change
212
- 5. **Handle loading** - Show skeleton while loading
213
-
214
- ## Complete Example
215
-
216
- ```typescript
217
- function SubscriptionScreen() {
218
- const { subscription, isLoading, refetch } = usePremium();
219
-
220
- useFocusEffect(
221
- useCallback(() => {
222
- refetch();
223
- }, [refetch])
224
- );
225
-
226
- if (isLoading) {
227
- return <PremiumDetailsCardSkeleton />;
228
- }
229
-
230
- if (!subscription?.isPremium) {
231
- return (
232
- <PremiumDetailsCard
233
- status={{
234
- type: 'free',
235
- isActive: false,
236
- isPremium: false,
237
- }}
238
- onUpgradePress={() => navigation.navigate('Paywall')}
239
- />
240
- );
241
- }
242
-
243
- return (
244
- <ScrollView>
245
- <PremiumDetailsCard
246
- status={subscription}
247
- onManagePress={handleManageSubscription}
248
- />
249
-
250
- {/* Additional premium features */}
251
- <PremiumFeaturesList />
252
- </ScrollView>
253
- );
254
- }
255
- ```
256
-
257
- ## Related Components
258
-
259
- - **PremiumStatusBadge** - Compact premium badge
260
- - **SubscriptionSection** - Full subscription section
261
- - **PaywallModal** - Upgrade paywall
262
-
263
- ## See Also
264
-
265
- - [Details Components README](../details/README.md)
266
- - [PremiumStatusBadge](./PremiumStatusBadge.md)
89
+ - **PremiumStatusBadge**: Status badge component
90
+ - **DetailRow**: Detail item component
91
+ - **SubscriptionSection**: Subscription section
92
+ - **usePremium**: Premium status hook
93
+ - **Details README**: `./README.md`