@umituz/react-native-subscription 2.2.5 → 2.2.7

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.5",
3
+ "version": "2.2.7",
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",
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import React from "react";
7
- import { View, StyleSheet } from "react-native";
7
+ import { View, StyleSheet, TouchableOpacity, Linking } from "react-native";
8
8
  import { AtomicText } from "@umituz/react-native-design-system-atoms";
9
9
  import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
10
- import { LegalLinks } from "@umituz/react-native-legal";
10
+ // import { LegalLinks } from "@umituz/react-native-legal";
11
11
 
12
12
  interface PaywallLegalFooterProps {
13
13
  termsText?: string;
@@ -38,13 +38,33 @@ export const PaywallLegalFooter: React.FC<PaywallLegalFooterProps> = React.memo(
38
38
  >
39
39
  {termsText}
40
40
  </AtomicText>
41
- <LegalLinks
42
- style={styles.legalLinks}
43
- privacyPolicyUrl={privacyUrl}
44
- termsOfServiceUrl={termsUrl}
45
- privacyText={privacyText || "Privacy Policy"}
46
- termsText={termsOfServiceText || "Terms of Service"}
47
- />
41
+ <View style={styles.legalLinksContainer}>
42
+ {privacyUrl && (
43
+ <TouchableOpacity onPress={() => Linking.openURL(privacyUrl).catch(console.error)}>
44
+ <AtomicText
45
+ type="labelSmall"
46
+ style={[styles.linkText, { color: tokens.colors.textSecondary }]}
47
+ >
48
+ {privacyText || "Privacy Policy"}
49
+ </AtomicText>
50
+ </TouchableOpacity>
51
+ )}
52
+ {privacyUrl && termsUrl && (
53
+ <AtomicText type="labelSmall" style={{ color: tokens.colors.textTertiary }}>
54
+ {" • "}
55
+ </AtomicText>
56
+ )}
57
+ {termsUrl && (
58
+ <TouchableOpacity onPress={() => Linking.openURL(termsUrl).catch(console.error)}>
59
+ <AtomicText
60
+ type="labelSmall"
61
+ style={[styles.linkText, { color: tokens.colors.textSecondary }]}
62
+ >
63
+ {termsOfServiceText || "Terms of Service"}
64
+ </AtomicText>
65
+ </TouchableOpacity>
66
+ )}
67
+ </View>
48
68
  </View>
49
69
  );
50
70
  }
@@ -64,7 +84,12 @@ const styles = StyleSheet.create({
64
84
  lineHeight: 16,
65
85
  marginBottom: 8,
66
86
  },
67
- legalLinks: {
87
+ legalLinksContainer: {
88
+ flexDirection: "row",
89
+ alignItems: "center",
68
90
  marginTop: 4,
69
91
  },
92
+ linkText: {
93
+ textDecorationLine: "underline",
94
+ },
70
95
  });
@@ -39,6 +39,7 @@ export interface SubscriptionModalProps {
39
39
  termsUrl?: string;
40
40
  privacyText?: string;
41
41
  termsOfServiceText?: string;
42
+ showRestoreButton?: boolean;
42
43
  }
43
44
 
44
45
  export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo(
@@ -61,6 +62,7 @@ export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo(
61
62
  termsUrl,
62
63
  privacyText,
63
64
  termsOfServiceText,
65
+ showRestoreButton = true,
64
66
  }) => {
65
67
  const tokens = useAppDesignTokens();
66
68
  const [selectedPkg, setSelectedPkg] = useState<PurchasesPackage | null>(null);
@@ -170,15 +172,17 @@ export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo(
170
172
  disabled={!selectedPkg || isProcessing || isLoading}
171
173
  />
172
174
  )}
173
- <TouchableOpacity
174
- style={styles.restoreButton}
175
- onPress={handleRestore}
176
- disabled={isProcessing || isLoading}
177
- >
178
- <AtomicText type="bodySmall" style={{ color: tokens.colors.textSecondary }}>
179
- {restoreButtonText}
180
- </AtomicText>
181
- </TouchableOpacity>
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
+ )}
182
186
  </View>
183
187
 
184
188
  <PaywallLegalFooter