@umituz/react-native-subscription 2.2.26 → 2.2.28
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.28",
|
|
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",
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"README.md",
|
|
64
64
|
"LICENSE"
|
|
65
65
|
]
|
|
66
|
-
}
|
|
66
|
+
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useEffect } from "react";
|
|
7
7
|
import { View, Modal, StyleSheet, TouchableOpacity } from "react-native";
|
|
8
|
-
import { SafeAreaView } from "react-native-safe-area-context";
|
|
9
8
|
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
10
9
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
11
10
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
@@ -94,7 +93,7 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo(
|
|
|
94
93
|
<Modal
|
|
95
94
|
visible={visible}
|
|
96
95
|
transparent
|
|
97
|
-
animationType="
|
|
96
|
+
animationType="fade"
|
|
98
97
|
onRequestClose={onClose}
|
|
99
98
|
>
|
|
100
99
|
<View style={styles.overlay}>
|
|
@@ -106,7 +105,7 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo(
|
|
|
106
105
|
<View
|
|
107
106
|
style={[styles.content, { backgroundColor: tokens.colors.surface }]}
|
|
108
107
|
>
|
|
109
|
-
<
|
|
108
|
+
<View style={styles.contentInner}>
|
|
110
109
|
<PaywallHeader
|
|
111
110
|
title={displayTitle}
|
|
112
111
|
subtitle={displaySubtitle}
|
|
@@ -148,7 +147,7 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo(
|
|
|
148
147
|
restoreButtonText={restoreButtonText}
|
|
149
148
|
/>
|
|
150
149
|
)}
|
|
151
|
-
</
|
|
150
|
+
</View>
|
|
152
151
|
</View>
|
|
153
152
|
</View>
|
|
154
153
|
</Modal>
|
|
@@ -161,19 +160,26 @@ PaywallModal.displayName = "PaywallModal";
|
|
|
161
160
|
const styles = StyleSheet.create({
|
|
162
161
|
overlay: {
|
|
163
162
|
flex: 1,
|
|
164
|
-
justifyContent: "
|
|
163
|
+
justifyContent: "center",
|
|
164
|
+
alignItems: "center",
|
|
165
|
+
paddingHorizontal: 20,
|
|
165
166
|
},
|
|
166
167
|
backdrop: {
|
|
167
168
|
...StyleSheet.absoluteFillObject,
|
|
168
|
-
backgroundColor: "rgba(0, 0, 0, 0.
|
|
169
|
+
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
169
170
|
},
|
|
170
171
|
content: {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
borderRadius: 32,
|
|
173
|
+
maxHeight: "88%",
|
|
174
|
+
width: "92%",
|
|
175
|
+
maxWidth: 480,
|
|
176
|
+
overflow: "hidden",
|
|
177
|
+
borderWidth: 1,
|
|
178
|
+
borderColor: "rgba(255, 255, 255, 0.08)",
|
|
175
179
|
},
|
|
176
|
-
|
|
180
|
+
contentInner: {
|
|
177
181
|
flex: 1,
|
|
182
|
+
paddingTop: 20,
|
|
183
|
+
paddingBottom: 20,
|
|
178
184
|
},
|
|
179
185
|
});
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, StyleSheet, ScrollView } from "react-native";
|
|
8
|
-
import { SafeAreaView } from "react-native-safe-area-context";
|
|
9
8
|
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
10
9
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
11
10
|
|
|
@@ -79,12 +78,12 @@ export const SubscriptionModal: React.FC<SubscriptionModalProps> = React.memo((p
|
|
|
79
78
|
|
|
80
79
|
if (!visible) return null;
|
|
81
80
|
|
|
82
|
-
const ContentWrapper =
|
|
83
|
-
const
|
|
81
|
+
const ContentWrapper = View;
|
|
82
|
+
const containerStyle = variant === "fullscreen" ? styles.fullscreenContainer : styles.container;
|
|
84
83
|
|
|
85
84
|
return (
|
|
86
85
|
<SubscriptionModalOverlay visible={visible} onClose={onClose} variant={variant}>
|
|
87
|
-
<ContentWrapper
|
|
86
|
+
<ContentWrapper style={containerStyle}>
|
|
88
87
|
<SubscriptionModalHeader title={title} subtitle={subtitle} onClose={onClose} />
|
|
89
88
|
|
|
90
89
|
<ScrollView
|
|
@@ -137,6 +136,12 @@ const styles = StyleSheet.create({
|
|
|
137
136
|
flex: 1,
|
|
138
137
|
width: "100%",
|
|
139
138
|
},
|
|
139
|
+
fullscreenContainer: {
|
|
140
|
+
flex: 1,
|
|
141
|
+
width: "100%",
|
|
142
|
+
paddingTop: 20,
|
|
143
|
+
paddingBottom: 20,
|
|
144
|
+
},
|
|
140
145
|
scrollView: {
|
|
141
146
|
flex: 1,
|
|
142
147
|
width: "100%",
|
|
@@ -43,12 +43,19 @@ export const SubscriptionModalOverlay: React.FC<SubscriptionModalOverlayProps> =
|
|
|
43
43
|
return (
|
|
44
44
|
<Modal
|
|
45
45
|
visible={visible}
|
|
46
|
-
transparent
|
|
47
|
-
animationType="
|
|
46
|
+
transparent
|
|
47
|
+
animationType="fade"
|
|
48
48
|
onRequestClose={onClose}
|
|
49
49
|
>
|
|
50
|
-
<View style={
|
|
51
|
-
|
|
50
|
+
<View style={styles.fullscreenOverlay}>
|
|
51
|
+
<TouchableOpacity
|
|
52
|
+
style={styles.fullscreenBackdrop}
|
|
53
|
+
activeOpacity={1}
|
|
54
|
+
onPress={onClose}
|
|
55
|
+
/>
|
|
56
|
+
<View style={[styles.fullscreenContent, { backgroundColor: tokens.colors.surface }]}>
|
|
57
|
+
{children}
|
|
58
|
+
</View>
|
|
52
59
|
</View>
|
|
53
60
|
</Modal>
|
|
54
61
|
);
|
|
@@ -93,8 +100,34 @@ const styles = StyleSheet.create({
|
|
|
93
100
|
...StyleSheet.absoluteFillObject,
|
|
94
101
|
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
|
95
102
|
},
|
|
96
|
-
|
|
103
|
+
fullscreenOverlay: {
|
|
97
104
|
flex: 1,
|
|
105
|
+
justifyContent: "center",
|
|
106
|
+
alignItems: "center",
|
|
107
|
+
paddingHorizontal: 20,
|
|
108
|
+
},
|
|
109
|
+
fullscreenBackdrop: {
|
|
110
|
+
...StyleSheet.absoluteFillObject,
|
|
111
|
+
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
112
|
+
},
|
|
113
|
+
fullscreenContent: {
|
|
114
|
+
width: Math.min(SCREEN_WIDTH * 0.92, 480),
|
|
115
|
+
maxHeight: SCREEN_HEIGHT * 0.88,
|
|
116
|
+
borderRadius: 32,
|
|
117
|
+
overflow: "hidden",
|
|
118
|
+
borderWidth: 1,
|
|
119
|
+
borderColor: "rgba(255, 255, 255, 0.08)",
|
|
120
|
+
...Platform.select({
|
|
121
|
+
ios: {
|
|
122
|
+
shadowColor: "#000",
|
|
123
|
+
shadowOffset: { width: 0, height: 16 },
|
|
124
|
+
shadowOpacity: 0.5,
|
|
125
|
+
shadowRadius: 32,
|
|
126
|
+
},
|
|
127
|
+
android: {
|
|
128
|
+
elevation: 16,
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
98
131
|
},
|
|
99
132
|
bottomSheet: {
|
|
100
133
|
borderTopLeftRadius: 32,
|
|
@@ -110,7 +143,7 @@ const styles = StyleSheet.create({
|
|
|
110
143
|
borderRadius: 32,
|
|
111
144
|
overflow: "hidden",
|
|
112
145
|
borderWidth: 1,
|
|
113
|
-
borderColor: "rgba(255, 255, 255, 0.1)",
|
|
146
|
+
borderColor: "rgba(255, 255, 255, 0.1)",
|
|
114
147
|
...Platform.select({
|
|
115
148
|
ios: {
|
|
116
149
|
shadowColor: "#000",
|