@umituz/react-native-subscription 2.2.4 → 2.2.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"README.md",
|
|
59
59
|
"LICENSE"
|
|
60
60
|
]
|
|
61
|
-
}
|
|
61
|
+
}
|
|
@@ -11,13 +11,23 @@ import { LegalLinks } from "@umituz/react-native-legal";
|
|
|
11
11
|
|
|
12
12
|
interface PaywallLegalFooterProps {
|
|
13
13
|
termsText?: string;
|
|
14
|
+
privacyUrl?: string;
|
|
15
|
+
termsUrl?: string;
|
|
16
|
+
privacyText?: string;
|
|
17
|
+
termsOfServiceText?: string;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
const DEFAULT_TERMS =
|
|
17
21
|
"Payment will be charged to your account. Subscription automatically renews unless cancelled.";
|
|
18
22
|
|
|
19
23
|
export const PaywallLegalFooter: React.FC<PaywallLegalFooterProps> = React.memo(
|
|
20
|
-
({
|
|
24
|
+
({
|
|
25
|
+
termsText = DEFAULT_TERMS,
|
|
26
|
+
privacyUrl,
|
|
27
|
+
termsUrl,
|
|
28
|
+
privacyText,
|
|
29
|
+
termsOfServiceText
|
|
30
|
+
}) => {
|
|
21
31
|
const tokens = useAppDesignTokens();
|
|
22
32
|
|
|
23
33
|
return (
|
|
@@ -28,7 +38,13 @@ export const PaywallLegalFooter: React.FC<PaywallLegalFooterProps> = React.memo(
|
|
|
28
38
|
>
|
|
29
39
|
{termsText}
|
|
30
40
|
</AtomicText>
|
|
31
|
-
<LegalLinks
|
|
41
|
+
<LegalLinks
|
|
42
|
+
style={styles.legalLinks}
|
|
43
|
+
privacyPolicyUrl={privacyUrl}
|
|
44
|
+
termsOfServiceUrl={termsUrl}
|
|
45
|
+
privacyText={privacyText || "Privacy Policy"}
|
|
46
|
+
termsText={termsOfServiceText || "Terms of Service"}
|
|
47
|
+
/>
|
|
32
48
|
</View>
|
|
33
49
|
);
|
|
34
50
|
}
|
|
@@ -35,6 +35,11 @@ export interface SubscriptionModalProps {
|
|
|
35
35
|
loadingText?: string;
|
|
36
36
|
emptyText?: string;
|
|
37
37
|
processingText?: string;
|
|
38
|
+
privacyUrl?: string;
|
|
39
|
+
termsUrl?: string;
|
|
40
|
+
privacyText?: string;
|
|
41
|
+
termsOfServiceText?: string;
|
|
42
|
+
showRestoreButton?: boolean;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo(
|
|
@@ -53,6 +58,11 @@ export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo(
|
|
|
53
58
|
loadingText = "Loading packages...",
|
|
54
59
|
emptyText = "No packages available",
|
|
55
60
|
processingText = "Processing...",
|
|
61
|
+
privacyUrl,
|
|
62
|
+
termsUrl,
|
|
63
|
+
privacyText,
|
|
64
|
+
termsOfServiceText,
|
|
65
|
+
showRestoreButton = true,
|
|
56
66
|
}) => {
|
|
57
67
|
const tokens = useAppDesignTokens();
|
|
58
68
|
const [selectedPkg, setSelectedPkg] = useState<PurchasesPackage | null>(null);
|
|
@@ -162,18 +172,25 @@ export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo(
|
|
|
162
172
|
disabled={!selectedPkg || isProcessing || isLoading}
|
|
163
173
|
/>
|
|
164
174
|
)}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
{showRestoreButton && (
|
|
176
|
+
<TouchableOpacity
|
|
177
|
+
style={styles.restoreButton}
|
|
178
|
+
onPress={handleRestore}
|
|
179
|
+
disabled={isProcessing || isLoading}
|
|
180
|
+
>
|
|
181
|
+
<AtomicText type="bodySmall" style={{ color: tokens.colors.textSecondary }}>
|
|
182
|
+
{restoreButtonText}
|
|
183
|
+
</AtomicText>
|
|
184
|
+
</TouchableOpacity>
|
|
185
|
+
)}
|
|
174
186
|
</View>
|
|
175
187
|
|
|
176
|
-
<PaywallLegalFooter
|
|
188
|
+
<PaywallLegalFooter
|
|
189
|
+
privacyUrl={privacyUrl}
|
|
190
|
+
termsUrl={termsUrl}
|
|
191
|
+
privacyText={privacyText}
|
|
192
|
+
termsOfServiceText={termsOfServiceText}
|
|
193
|
+
/>
|
|
177
194
|
</SafeAreaView>
|
|
178
195
|
</View>
|
|
179
196
|
</View>
|