@umituz/react-native-subscription 2.39.10 → 2.39.12
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.39.
|
|
3
|
+
"version": "2.39.12",
|
|
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",
|
|
@@ -20,6 +20,7 @@ import { Image } from "expo-image";
|
|
|
20
20
|
import { PlanCard } from "./PlanCard";
|
|
21
21
|
import { paywallScreenStyles as styles } from "./PaywallScreen.styles";
|
|
22
22
|
import { PaywallFooter } from "./PaywallFooter";
|
|
23
|
+
import { PurchaseLoadingOverlay } from "../../subscription/presentation/components/overlay/PurchaseLoadingOverlay";
|
|
23
24
|
import { usePaywallActions } from "../hooks/usePaywallActions";
|
|
24
25
|
import { PaywallScreenProps } from "./PaywallScreen.types";
|
|
25
26
|
import {
|
|
@@ -50,7 +51,14 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
|
|
|
50
51
|
const tokens = useAppDesignTokens();
|
|
51
52
|
const insets = useSafeAreaInsets();
|
|
52
53
|
|
|
53
|
-
const {
|
|
54
|
+
const {
|
|
55
|
+
selectedPlanId,
|
|
56
|
+
setSelectedPlanId,
|
|
57
|
+
isProcessing,
|
|
58
|
+
handlePurchase,
|
|
59
|
+
handleRestore,
|
|
60
|
+
resetState
|
|
61
|
+
} = usePaywallActions({
|
|
54
62
|
packages,
|
|
55
63
|
onPurchase,
|
|
56
64
|
onRestore,
|
|
@@ -61,6 +69,13 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
|
|
|
61
69
|
onClose
|
|
62
70
|
});
|
|
63
71
|
|
|
72
|
+
// Reset state when screen is closed to avoid lockups
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
return () => {
|
|
75
|
+
resetState();
|
|
76
|
+
};
|
|
77
|
+
}, [resetState]);
|
|
78
|
+
|
|
64
79
|
// Auto-select first package
|
|
65
80
|
useEffect(() => {
|
|
66
81
|
if (packages.length > 0 && !selectedPlanId) {
|
|
@@ -6,13 +6,18 @@ import { formatPriceWithPeriod } from '../../../utils/priceUtils';
|
|
|
6
6
|
import { PlanCardProps } from "./PlanCard.types";
|
|
7
7
|
|
|
8
8
|
export const PlanCard: React.FC<PlanCardProps> = React.memo(
|
|
9
|
-
({ pkg, isSelected, onSelect, badge, creditAmount, creditsLabel }) => {
|
|
9
|
+
({ pkg, isSelected, onSelect, badge, creditAmount, creditsLabel, disabled }) => {
|
|
10
10
|
const tokens = useAppDesignTokens();
|
|
11
11
|
const title = pkg.product.title;
|
|
12
12
|
const price = formatPriceWithPeriod(pkg.product.price, pkg.product.currencyCode, pkg.identifier);
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<TouchableOpacity
|
|
15
|
+
<TouchableOpacity
|
|
16
|
+
onPress={onSelect}
|
|
17
|
+
disabled={disabled}
|
|
18
|
+
activeOpacity={0.7}
|
|
19
|
+
style={[styles.touchable, disabled && { opacity: 0.8 }]}
|
|
20
|
+
>
|
|
16
21
|
<View style={[styles.container, {
|
|
17
22
|
backgroundColor: tokens.colors.surface,
|
|
18
23
|
borderColor: isSelected ? tokens.colors.primary : tokens.colors.border,
|