@umituz/react-native-subscription 3.1.21 → 3.1.23
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/domains/paywall/components/PaywallFooter.tsx +30 -2
- package/src/domains/paywall/components/PaywallScreen.styles.ts +36 -2
- package/src/domains/paywall/components/PaywallScreen.tsx +2 -0
- package/src/domains/subscription/presentation/components/feedback/PaywallFeedbackScreen.tsx +9 -7
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.23",
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, TouchableOpacity } from "react-native";
|
|
3
|
-
import { AtomicText } from "@umituz/react-native-design-system/atoms";
|
|
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
6
|
import { paywallScreenStyles as styles } from "./PaywallScreen.styles";
|
|
@@ -9,21 +9,47 @@ interface PaywallFooterProps {
|
|
|
9
9
|
translations: PaywallTranslations;
|
|
10
10
|
legalUrls: PaywallLegalUrls;
|
|
11
11
|
isProcessing: boolean;
|
|
12
|
+
onPurchase?: () => void | Promise<void>;
|
|
12
13
|
onRestore?: () => Promise<void | boolean>;
|
|
13
14
|
onLegalClick: (url: string | undefined) => void;
|
|
15
|
+
purchaseButtonText?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export const PaywallFooter: React.FC<PaywallFooterProps> = React.memo(({
|
|
17
19
|
translations,
|
|
18
20
|
legalUrls,
|
|
19
21
|
isProcessing,
|
|
22
|
+
onPurchase,
|
|
20
23
|
onRestore,
|
|
21
24
|
onLegalClick,
|
|
25
|
+
purchaseButtonText,
|
|
22
26
|
}) => {
|
|
23
27
|
const tokens = useAppDesignTokens();
|
|
24
|
-
|
|
28
|
+
|
|
25
29
|
return (
|
|
26
30
|
<View style={styles.footer}>
|
|
31
|
+
{/* Purchase Button */}
|
|
32
|
+
{onPurchase && (
|
|
33
|
+
<TouchableOpacity
|
|
34
|
+
onPress={onPurchase}
|
|
35
|
+
disabled={isProcessing}
|
|
36
|
+
style={[
|
|
37
|
+
styles.purchaseButton,
|
|
38
|
+
isProcessing && styles.ctaDisabled,
|
|
39
|
+
{ backgroundColor: tokens.colors.primary }
|
|
40
|
+
]}
|
|
41
|
+
>
|
|
42
|
+
{isProcessing ? (
|
|
43
|
+
<AtomicSpinner size="sm" />
|
|
44
|
+
) : (
|
|
45
|
+
<AtomicText type="body" style={[styles.purchaseButtonText, { color: tokens.colors.textPrimary }]}>
|
|
46
|
+
{purchaseButtonText || translations.purchaseButtonText}
|
|
47
|
+
</AtomicText>
|
|
48
|
+
)}
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
)}
|
|
51
|
+
|
|
52
|
+
{/* Restore Button */}
|
|
27
53
|
{onRestore && (
|
|
28
54
|
<TouchableOpacity onPress={onRestore} disabled={isProcessing} style={[styles.restoreButton, isProcessing && styles.ctaDisabled]}>
|
|
29
55
|
<AtomicText type="bodySmall" style={[styles.footerLink, { color: tokens.colors.textSecondary }]}>
|
|
@@ -31,6 +57,8 @@ export const PaywallFooter: React.FC<PaywallFooterProps> = React.memo(({
|
|
|
31
57
|
</AtomicText>
|
|
32
58
|
</TouchableOpacity>
|
|
33
59
|
)}
|
|
60
|
+
|
|
61
|
+
{/* Legal Links */}
|
|
34
62
|
<View style={styles.legalRow}>
|
|
35
63
|
{legalUrls.termsUrl && (
|
|
36
64
|
<TouchableOpacity onPress={() => onLegalClick(legalUrls.termsUrl)}>
|
|
@@ -123,9 +123,43 @@ export const paywallScreenStyles = StyleSheet.create({
|
|
|
123
123
|
|
|
124
124
|
// Footer Links
|
|
125
125
|
footer: {
|
|
126
|
-
|
|
126
|
+
position: "absolute",
|
|
127
|
+
bottom: 0,
|
|
128
|
+
left: 0,
|
|
129
|
+
right: 0,
|
|
130
|
+
paddingHorizontal: 24,
|
|
131
|
+
paddingTop: 20,
|
|
132
|
+
paddingBottom: 40,
|
|
133
|
+
borderTopWidth: 1,
|
|
134
|
+
borderTopColor: "rgba(255, 255, 255, 0.08)",
|
|
135
|
+
...Platform.select({
|
|
136
|
+
ios: {
|
|
137
|
+
shadowColor: "#000",
|
|
138
|
+
shadowOffset: { width: 0, height: -4 },
|
|
139
|
+
shadowOpacity: 0.1,
|
|
140
|
+
shadowRadius: 12,
|
|
141
|
+
},
|
|
142
|
+
android: {
|
|
143
|
+
elevation: 8,
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
},
|
|
147
|
+
purchaseButton: {
|
|
148
|
+
borderRadius: 18,
|
|
149
|
+
height: 60,
|
|
150
|
+
justifyContent: "center",
|
|
127
151
|
alignItems: "center",
|
|
128
|
-
|
|
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,
|
|
129
163
|
},
|
|
130
164
|
restoreButton: {
|
|
131
165
|
paddingVertical: 4,
|
|
@@ -75,6 +75,7 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
|
|
|
75
75
|
selectedPlanId,
|
|
76
76
|
setSelectedPlanId,
|
|
77
77
|
isProcessing,
|
|
78
|
+
handlePurchase,
|
|
78
79
|
handleRestore,
|
|
79
80
|
resetState
|
|
80
81
|
} = usePaywallActions({
|
|
@@ -231,6 +232,7 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
|
|
|
231
232
|
translations={translations}
|
|
232
233
|
legalUrls={legalUrls}
|
|
233
234
|
isProcessing={isProcessing}
|
|
235
|
+
onPurchase={handlePurchase}
|
|
234
236
|
onRestore={handleRestore}
|
|
235
237
|
onLegalClick={handleLegalUrl}
|
|
236
238
|
/>
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import React, { useMemo } from "react";
|
|
10
10
|
import { View, ScrollView } from "react-native";
|
|
11
11
|
import { useSafeAreaInsets } from "@umituz/react-native-design-system/safe-area";
|
|
12
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
12
13
|
import { usePaywallFeedback } from "../../../../../presentation/hooks/feedback/usePaywallFeedback";
|
|
13
14
|
import type { PaywallFeedbackScreenProps, PaywallFeedbackTranslations } from "./PaywallFeedbackScreen.types";
|
|
14
15
|
import {
|
|
@@ -27,6 +28,7 @@ export const PaywallFeedbackScreen: React.FC<PaywallFeedbackScreenProps> = React
|
|
|
27
28
|
onSubmit,
|
|
28
29
|
}) => {
|
|
29
30
|
const insets = useSafeAreaInsets();
|
|
31
|
+
const tokens = useAppDesignTokens();
|
|
30
32
|
|
|
31
33
|
const {
|
|
32
34
|
selectedReason,
|
|
@@ -41,13 +43,13 @@ export const PaywallFeedbackScreen: React.FC<PaywallFeedbackScreenProps> = React
|
|
|
41
43
|
const screenStyles = useMemo(() => createScreenStyles(), []);
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
<View style={[screenStyles.container, { backgroundColor:
|
|
46
|
+
<View style={[screenStyles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}>
|
|
45
47
|
{/* Close button */}
|
|
46
48
|
<FeedbackCloseButton
|
|
47
49
|
onPress={handleSkip}
|
|
48
50
|
topInset={insets.top}
|
|
49
|
-
backgroundColor=
|
|
50
|
-
iconColor=
|
|
51
|
+
backgroundColor={tokens.colors.surfaceSecondary}
|
|
52
|
+
iconColor={tokens.colors.textPrimary}
|
|
51
53
|
/>
|
|
52
54
|
|
|
53
55
|
{/* Scrollable content */}
|
|
@@ -60,8 +62,8 @@ export const PaywallFeedbackScreen: React.FC<PaywallFeedbackScreenProps> = React
|
|
|
60
62
|
<FeedbackHeader
|
|
61
63
|
title={translations.title}
|
|
62
64
|
subtitle={translations.subtitle}
|
|
63
|
-
titleColor=
|
|
64
|
-
subtitleColor=
|
|
65
|
+
titleColor={tokens.colors.textPrimary}
|
|
66
|
+
subtitleColor={tokens.colors.textSecondary}
|
|
65
67
|
style={screenStyles.header}
|
|
66
68
|
/>
|
|
67
69
|
|
|
@@ -81,8 +83,8 @@ export const PaywallFeedbackScreen: React.FC<PaywallFeedbackScreenProps> = React
|
|
|
81
83
|
<FeedbackSubmitButton
|
|
82
84
|
title={translations.submit}
|
|
83
85
|
canSubmit={canSubmit}
|
|
84
|
-
backgroundColor=
|
|
85
|
-
textColor=
|
|
86
|
+
backgroundColor={tokens.colors.primary}
|
|
87
|
+
textColor={tokens.colors.textPrimary}
|
|
86
88
|
onPress={handleSubmit}
|
|
87
89
|
bottomInset={insets.bottom}
|
|
88
90
|
/>
|