@umituz/react-native-subscription 3.1.24 → 3.1.25
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": "3.1.
|
|
3
|
+
"version": "3.1.25",
|
|
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",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { View, TouchableOpacity } from "react-native";
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
3
|
import { AtomicText, AtomicSpinner } from "@umituz/react-native-design-system/atoms";
|
|
4
4
|
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
5
5
|
import type { PaywallTranslations, PaywallLegalUrls } from "../entities/types";
|
|
6
|
-
import { paywallScreenStyles as styles } from "./PaywallScreen.styles";
|
|
7
6
|
|
|
8
7
|
interface PaywallFooterProps {
|
|
9
8
|
translations: PaywallTranslations;
|
|
@@ -27,54 +26,129 @@ export const PaywallFooter: React.FC<PaywallFooterProps> = React.memo(({
|
|
|
27
26
|
const tokens = useAppDesignTokens();
|
|
28
27
|
|
|
29
28
|
return (
|
|
30
|
-
<View style={
|
|
31
|
-
{/* Purchase Button */}
|
|
29
|
+
<View style={footerStyles.container}>
|
|
30
|
+
{/* Purchase Button - Large and prominent */}
|
|
32
31
|
{onPurchase && (
|
|
33
32
|
<TouchableOpacity
|
|
34
33
|
onPress={onPurchase}
|
|
35
34
|
disabled={isProcessing}
|
|
35
|
+
activeOpacity={0.8}
|
|
36
36
|
style={[
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
footerStyles.purchaseButton,
|
|
38
|
+
{ backgroundColor: tokens.colors.primary },
|
|
39
|
+
isProcessing && footerStyles.buttonDisabled,
|
|
40
40
|
]}
|
|
41
41
|
>
|
|
42
42
|
{isProcessing ? (
|
|
43
|
-
<
|
|
43
|
+
<View style={footerStyles.loadingContainer}>
|
|
44
|
+
<AtomicSpinner size="sm" />
|
|
45
|
+
</View>
|
|
44
46
|
) : (
|
|
45
|
-
<AtomicText style={[
|
|
47
|
+
<AtomicText style={[footerStyles.purchaseButtonText, { color: tokens.colors.textPrimary }]}>
|
|
46
48
|
{purchaseButtonText || translations.purchaseButtonText}
|
|
47
49
|
</AtomicText>
|
|
48
50
|
)}
|
|
49
51
|
</TouchableOpacity>
|
|
50
52
|
)}
|
|
51
53
|
|
|
52
|
-
{/* Restore
|
|
54
|
+
{/* Restore Link - Minimal */}
|
|
53
55
|
{onRestore && (
|
|
54
|
-
<TouchableOpacity
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
<TouchableOpacity
|
|
57
|
+
onPress={onRestore}
|
|
58
|
+
disabled={isProcessing}
|
|
59
|
+
activeOpacity={0.6}
|
|
60
|
+
style={footerStyles.restoreButton}
|
|
61
|
+
>
|
|
62
|
+
<AtomicText style={[footerStyles.restoreText, { color: tokens.colors.textSecondary }]}>
|
|
63
|
+
{translations.restoreButtonText}
|
|
57
64
|
</AtomicText>
|
|
58
65
|
</TouchableOpacity>
|
|
59
66
|
)}
|
|
60
67
|
|
|
61
|
-
{/* Legal Links */}
|
|
62
|
-
<View style={
|
|
68
|
+
{/* Legal Links - Minimal */}
|
|
69
|
+
<View style={footerStyles.legalContainer}>
|
|
63
70
|
{legalUrls.termsUrl && (
|
|
64
|
-
<TouchableOpacity
|
|
65
|
-
|
|
71
|
+
<TouchableOpacity
|
|
72
|
+
onPress={() => onLegalClick(legalUrls.termsUrl)}
|
|
73
|
+
activeOpacity={0.6}
|
|
74
|
+
>
|
|
75
|
+
<AtomicText style={[footerStyles.legalText, { color: tokens.colors.textTertiary }]}>
|
|
66
76
|
{translations.termsOfServiceText}
|
|
67
77
|
</AtomicText>
|
|
68
78
|
</TouchableOpacity>
|
|
69
79
|
)}
|
|
70
80
|
{legalUrls.privacyUrl && (
|
|
71
|
-
|
|
72
|
-
<AtomicText
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
<>
|
|
82
|
+
<AtomicText style={footerStyles.legalSeparator}> • </AtomicText>
|
|
83
|
+
<TouchableOpacity
|
|
84
|
+
onPress={() => onLegalClick(legalUrls.privacyUrl)}
|
|
85
|
+
activeOpacity={0.6}
|
|
86
|
+
>
|
|
87
|
+
<AtomicText style={[footerStyles.legalText, { color: tokens.colors.textTertiary }]}>
|
|
88
|
+
{translations.privacyText}
|
|
89
|
+
</AtomicText>
|
|
90
|
+
</TouchableOpacity>
|
|
91
|
+
</>
|
|
76
92
|
)}
|
|
77
93
|
</View>
|
|
78
94
|
</View>
|
|
79
95
|
);
|
|
80
96
|
});
|
|
97
|
+
|
|
98
|
+
// Modern footer styles
|
|
99
|
+
const footerStyles = StyleSheet.create({
|
|
100
|
+
container: {
|
|
101
|
+
width: '100%',
|
|
102
|
+
paddingHorizontal: 20,
|
|
103
|
+
paddingVertical: 16,
|
|
104
|
+
gap: 12,
|
|
105
|
+
},
|
|
106
|
+
purchaseButton: {
|
|
107
|
+
width: '100%',
|
|
108
|
+
height: 56,
|
|
109
|
+
borderRadius: 16,
|
|
110
|
+
justifyContent: 'center',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
shadowColor: '#000',
|
|
113
|
+
shadowOffset: { width: 0, height: 4 },
|
|
114
|
+
shadowOpacity: 0.3,
|
|
115
|
+
shadowRadius: 12,
|
|
116
|
+
elevation: 8,
|
|
117
|
+
},
|
|
118
|
+
buttonDisabled: {
|
|
119
|
+
opacity: 0.5,
|
|
120
|
+
},
|
|
121
|
+
loadingContainer: {
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
},
|
|
125
|
+
purchaseButtonText: {
|
|
126
|
+
fontSize: 17,
|
|
127
|
+
fontWeight: '700',
|
|
128
|
+
letterSpacing: 0.5,
|
|
129
|
+
},
|
|
130
|
+
restoreButton: {
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
paddingVertical: 4,
|
|
133
|
+
},
|
|
134
|
+
restoreText: {
|
|
135
|
+
fontSize: 13,
|
|
136
|
+
fontWeight: '500',
|
|
137
|
+
textDecorationLine: 'underline',
|
|
138
|
+
},
|
|
139
|
+
legalContainer: {
|
|
140
|
+
flexDirection: 'row',
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
justifyContent: 'center',
|
|
143
|
+
flexWrap: 'wrap',
|
|
144
|
+
},
|
|
145
|
+
legalText: {
|
|
146
|
+
fontSize: 11,
|
|
147
|
+
lineHeight: 16,
|
|
148
|
+
},
|
|
149
|
+
legalSeparator: {
|
|
150
|
+
fontSize: 11,
|
|
151
|
+
color: 'rgba(255, 255, 255, 0.4)',
|
|
152
|
+
marginHorizontal: 4,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
@@ -121,46 +121,31 @@ export const paywallScreenStyles = StyleSheet.create({
|
|
|
121
121
|
letterSpacing: 0.5,
|
|
122
122
|
},
|
|
123
123
|
|
|
124
|
-
// Footer
|
|
125
|
-
|
|
124
|
+
// Footer container with modern design
|
|
125
|
+
footerContainer: {
|
|
126
126
|
position: "absolute",
|
|
127
127
|
bottom: 0,
|
|
128
128
|
left: 0,
|
|
129
129
|
right: 0,
|
|
130
|
-
paddingHorizontal:
|
|
131
|
-
paddingTop:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
borderTopColor: "rgba(255, 255, 255, 0.08)",
|
|
130
|
+
paddingHorizontal: 20,
|
|
131
|
+
paddingTop: 16,
|
|
132
|
+
borderTopWidth: 0.5,
|
|
133
|
+
borderTopColor: "rgba(255, 255, 255, 0.1)",
|
|
135
134
|
...Platform.select({
|
|
136
135
|
ios: {
|
|
136
|
+
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
137
|
+
backdropFilter: "blur(20px)",
|
|
137
138
|
shadowColor: "#000",
|
|
138
|
-
shadowOffset: { width: 0, height: -
|
|
139
|
-
shadowOpacity: 0.
|
|
140
|
-
shadowRadius:
|
|
139
|
+
shadowOffset: { width: 0, height: -8 },
|
|
140
|
+
shadowOpacity: 0.3,
|
|
141
|
+
shadowRadius: 20,
|
|
141
142
|
},
|
|
142
143
|
android: {
|
|
143
|
-
|
|
144
|
+
backgroundColor: "#000000",
|
|
145
|
+
elevation: 12,
|
|
144
146
|
},
|
|
145
147
|
}),
|
|
146
148
|
},
|
|
147
|
-
purchaseButton: {
|
|
148
|
-
borderRadius: 18,
|
|
149
|
-
height: 60,
|
|
150
|
-
justifyContent: "center",
|
|
151
|
-
alignItems: "center",
|
|
152
|
-
shadowColor: "#000",
|
|
153
|
-
shadowOffset: { width: 0, height: 4 },
|
|
154
|
-
shadowOpacity: 0.3,
|
|
155
|
-
shadowRadius: 8,
|
|
156
|
-
elevation: 6,
|
|
157
|
-
marginBottom: 16,
|
|
158
|
-
},
|
|
159
|
-
purchaseButtonText: {
|
|
160
|
-
fontWeight: "700",
|
|
161
|
-
letterSpacing: 0.5,
|
|
162
|
-
fontSize: 16,
|
|
163
|
-
},
|
|
164
149
|
restoreButton: {
|
|
165
150
|
paddingVertical: 4,
|
|
166
151
|
},
|
|
@@ -194,6 +179,7 @@ export const paywallScreenStyles = StyleSheet.create({
|
|
|
194
179
|
// List
|
|
195
180
|
listContent: {
|
|
196
181
|
paddingBottom: 40,
|
|
182
|
+
paddingHorizontal: 20, // Add horizontal padding
|
|
197
183
|
},
|
|
198
184
|
loadingContainer: {
|
|
199
185
|
flex: 1,
|
|
@@ -220,22 +220,24 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
|
|
|
220
220
|
contentContainerStyle={[
|
|
221
221
|
styles.listContent,
|
|
222
222
|
{
|
|
223
|
-
paddingTop: Math.max(insets.top, 20) +
|
|
224
|
-
paddingBottom:
|
|
223
|
+
paddingTop: Math.max(insets.top, 20) + 50,
|
|
224
|
+
paddingBottom: 280 // Increased for footer
|
|
225
225
|
}
|
|
226
226
|
]}
|
|
227
227
|
showsVerticalScrollIndicator={false}
|
|
228
228
|
/>
|
|
229
229
|
|
|
230
|
-
{/* Fixed Footer */}
|
|
231
|
-
<
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
230
|
+
{/* Fixed Footer - Improved positioning */}
|
|
231
|
+
<View style={[styles.footerContainer, { paddingBottom: insets.bottom + 20 }]}>
|
|
232
|
+
<PaywallFooter
|
|
233
|
+
translations={translations}
|
|
234
|
+
legalUrls={legalUrls}
|
|
235
|
+
isProcessing={isProcessing}
|
|
236
|
+
onPurchase={handlePurchase}
|
|
237
|
+
onRestore={handleRestore}
|
|
238
|
+
onLegalClick={handleLegalUrl}
|
|
239
|
+
/>
|
|
240
|
+
</View>
|
|
239
241
|
</View>
|
|
240
242
|
);
|
|
241
243
|
});
|