@umituz/react-native-subscription 2.2.27 → 2.2.29
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 +1 -1
- package/src/presentation/components/paywall/PaywallHeader.tsx +13 -2
- package/src/presentation/components/paywall/PaywallModal.tsx +6 -4
- package/src/presentation/components/paywall/SubscriptionModal.tsx +10 -5
- package/src/presentation/components/paywall/SubscriptionModalHeader.tsx +11 -1
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.29",
|
|
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",
|
|
@@ -12,14 +12,17 @@ interface PaywallHeaderProps {
|
|
|
12
12
|
title: string;
|
|
13
13
|
subtitle?: string;
|
|
14
14
|
onClose: () => void;
|
|
15
|
+
variant?: "bottom-sheet" | "fullscreen" | "dialog";
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const PaywallHeader: React.FC<PaywallHeaderProps> = React.memo(
|
|
18
|
-
({ title, subtitle, onClose }) => {
|
|
19
|
+
({ title, subtitle, onClose, variant = "bottom-sheet" }) => {
|
|
19
20
|
const tokens = useAppDesignTokens();
|
|
20
21
|
|
|
22
|
+
const containerStyle = variant === "fullscreen" ? styles.containerFullscreen : styles.container;
|
|
23
|
+
|
|
21
24
|
return (
|
|
22
|
-
<View style={
|
|
25
|
+
<View style={containerStyle}>
|
|
23
26
|
<View style={styles.titleContainer}>
|
|
24
27
|
<AtomicText
|
|
25
28
|
type="headlineLarge"
|
|
@@ -62,6 +65,14 @@ const styles = StyleSheet.create({
|
|
|
62
65
|
paddingTop: 8,
|
|
63
66
|
paddingBottom: 16,
|
|
64
67
|
},
|
|
68
|
+
containerFullscreen: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
justifyContent: "space-between",
|
|
71
|
+
alignItems: "flex-start",
|
|
72
|
+
paddingHorizontal: 24,
|
|
73
|
+
paddingTop: 48,
|
|
74
|
+
paddingBottom: 16,
|
|
75
|
+
},
|
|
65
76
|
titleContainer: {
|
|
66
77
|
flex: 1,
|
|
67
78
|
marginRight: 16,
|
|
@@ -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";
|
|
@@ -106,11 +105,12 @@ 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}
|
|
113
112
|
onClose={onClose}
|
|
113
|
+
variant="fullscreen"
|
|
114
114
|
/>
|
|
115
115
|
|
|
116
116
|
<PaywallTabBar
|
|
@@ -148,7 +148,7 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo(
|
|
|
148
148
|
restoreButtonText={restoreButtonText}
|
|
149
149
|
/>
|
|
150
150
|
)}
|
|
151
|
-
</
|
|
151
|
+
</View>
|
|
152
152
|
</View>
|
|
153
153
|
</View>
|
|
154
154
|
</Modal>
|
|
@@ -178,7 +178,9 @@ const styles = StyleSheet.create({
|
|
|
178
178
|
borderWidth: 1,
|
|
179
179
|
borderColor: "rgba(255, 255, 255, 0.08)",
|
|
180
180
|
},
|
|
181
|
-
|
|
181
|
+
contentInner: {
|
|
182
182
|
flex: 1,
|
|
183
|
+
paddingTop: 20,
|
|
184
|
+
paddingBottom: 20,
|
|
183
185
|
},
|
|
184
186
|
});
|
|
@@ -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,13 +78,13 @@ 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
|
|
88
|
-
<SubscriptionModalHeader title={title} subtitle={subtitle} onClose={onClose} />
|
|
86
|
+
<ContentWrapper style={containerStyle}>
|
|
87
|
+
<SubscriptionModalHeader title={title} subtitle={subtitle} onClose={onClose} variant={variant} />
|
|
89
88
|
|
|
90
89
|
<ScrollView
|
|
91
90
|
style={styles.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%",
|
|
@@ -11,12 +11,14 @@ interface SubscriptionModalHeaderProps {
|
|
|
11
11
|
title: string;
|
|
12
12
|
subtitle?: string;
|
|
13
13
|
onClose: () => void;
|
|
14
|
+
variant?: "bottom-sheet" | "fullscreen" | "dialog";
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const SubscriptionModalHeader: React.FC<SubscriptionModalHeaderProps> = ({
|
|
17
18
|
title,
|
|
18
19
|
subtitle,
|
|
19
20
|
onClose,
|
|
21
|
+
variant = "bottom-sheet",
|
|
20
22
|
}) => {
|
|
21
23
|
const tokens = useAppDesignTokens();
|
|
22
24
|
|
|
@@ -24,8 +26,10 @@ export const SubscriptionModalHeader: React.FC<SubscriptionModalHeaderProps> = (
|
|
|
24
26
|
console.log("[SubscriptionModalHeader] Rendering title:", title);
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
const headerStyle = variant === "fullscreen" ? styles.headerFullscreen : styles.header;
|
|
30
|
+
|
|
27
31
|
return (
|
|
28
|
-
<View style={
|
|
32
|
+
<View style={headerStyle}>
|
|
29
33
|
<TouchableOpacity
|
|
30
34
|
style={styles.closeButton}
|
|
31
35
|
onPress={onClose}
|
|
@@ -60,6 +64,12 @@ const styles = StyleSheet.create({
|
|
|
60
64
|
paddingTop: 8,
|
|
61
65
|
paddingBottom: 16,
|
|
62
66
|
},
|
|
67
|
+
headerFullscreen: {
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
paddingHorizontal: 24,
|
|
70
|
+
paddingTop: 48,
|
|
71
|
+
paddingBottom: 16,
|
|
72
|
+
},
|
|
63
73
|
closeButton: {
|
|
64
74
|
position: "absolute",
|
|
65
75
|
top: 8,
|