@umituz/react-native-subscription 2.31.22 → 2.31.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.31.
|
|
3
|
+
"version": "2.31.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",
|
|
@@ -75,7 +75,6 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = (props) => {
|
|
|
75
75
|
onClose={handleClose}
|
|
76
76
|
translations={translations}
|
|
77
77
|
packages={packages}
|
|
78
|
-
isLoading={isLoading}
|
|
79
78
|
legalUrls={legalUrls}
|
|
80
79
|
features={features ? [...features] : undefined}
|
|
81
80
|
heroImage={heroImage}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from "react";
|
|
2
2
|
import { View, TouchableOpacity, Linking } from "react-native";
|
|
3
|
-
import { BaseModal, useAppDesignTokens, AtomicText, AtomicIcon,
|
|
3
|
+
import { BaseModal, useAppDesignTokens, AtomicText, AtomicIcon, useSafeAreaInsets } from "@umituz/react-native-design-system";
|
|
4
4
|
import { ScreenLayout } from "../../../shared/presentation";
|
|
5
5
|
import { Image } from "expo-image";
|
|
6
6
|
import { PlanCard } from "./PlanCard";
|
|
@@ -11,7 +11,7 @@ import { usePaywallActions } from "../hooks/usePaywallActions";
|
|
|
11
11
|
import { PaywallModalProps } from "./PaywallModal.types";
|
|
12
12
|
|
|
13
13
|
export const PaywallModal: React.FC<PaywallModalProps> = React.memo((props) => {
|
|
14
|
-
const { visible, onClose, translations, packages = [], features = [],
|
|
14
|
+
const { visible, onClose, translations, packages = [], features = [], legalUrls = {}, bestValueIdentifier, creditAmounts, creditsLabel, heroImage, onPurchase, onRestore, trialEligibility = {}, trialSubtitleText } = props;
|
|
15
15
|
const tokens = useAppDesignTokens();
|
|
16
16
|
const insets = useSafeAreaInsets();
|
|
17
17
|
const { selectedPlanId, setSelectedPlanId, isProcessing, handlePurchase, handleRestore, resetState } = usePaywallActions({ packages, onPurchase, onRestore });
|
|
@@ -42,19 +42,15 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo((props) => {
|
|
|
42
42
|
{translations.subtitle && <AtomicText type="bodyMedium" style={[styles.subtitle, { color: tokens.colors.textSecondary }]}>{translations.subtitle}</AtomicText>}
|
|
43
43
|
</View>
|
|
44
44
|
<PaywallFeatures features={features} />
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
55
|
-
})}
|
|
56
|
-
</View>
|
|
57
|
-
)}
|
|
45
|
+
<View style={styles.plans}>
|
|
46
|
+
{packages.map((pkg) => {
|
|
47
|
+
const pid = pkg.product.identifier;
|
|
48
|
+
const hasTrial = trialEligibility[pid]?.eligible ?? false;
|
|
49
|
+
return (
|
|
50
|
+
<PlanCard key={pid} pkg={pkg} isSelected={selectedPlanId === pid} onSelect={() => setSelectedPlanId(pid)} badge={pid === bestValueIdentifier ? translations.bestValueBadgeText : undefined} creditAmount={creditAmounts?.[pid]} creditsLabel={creditsLabel} hasFreeTrial={hasTrial} trialSubtitleText={hasTrial ? trialSubtitleText : undefined} />
|
|
51
|
+
);
|
|
52
|
+
})}
|
|
53
|
+
</View>
|
|
58
54
|
<TouchableOpacity onPress={handlePurchase} disabled={!selectedPlanId || isProcessing} style={[styles.cta, { backgroundColor: tokens.colors.primary }, (!selectedPlanId || isProcessing) && styles.ctaDisabled]} activeOpacity={0.8}>
|
|
59
55
|
<AtomicText type="titleLarge" style={[styles.ctaText, { color: tokens.colors.onPrimary }]}>{isProcessing ? translations.processingText : translations.purchaseButtonText}</AtomicText>
|
|
60
56
|
</TouchableOpacity>
|
|
@@ -13,7 +13,6 @@ export interface PaywallModalProps {
|
|
|
13
13
|
translations: PaywallTranslations;
|
|
14
14
|
packages?: PurchasesPackage[];
|
|
15
15
|
features?: SubscriptionFeature[];
|
|
16
|
-
isLoading?: boolean;
|
|
17
16
|
legalUrls?: PaywallLegalUrls;
|
|
18
17
|
bestValueIdentifier?: string;
|
|
19
18
|
creditAmounts?: Record<string, number>;
|