@umituz/react-native-subscription 2.37.96 → 2.37.97
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.37.
|
|
3
|
+
"version": "2.37.97",
|
|
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",
|
|
@@ -32,6 +32,13 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo((props) => {
|
|
|
32
32
|
if (!visible) resetState();
|
|
33
33
|
}, [visible, resetState]);
|
|
34
34
|
|
|
35
|
+
// Auto-select first package when packages load and none is selected
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (packages.length > 0 && !selectedPlanId) {
|
|
38
|
+
setSelectedPlanId(packages[0].product.identifier);
|
|
39
|
+
}
|
|
40
|
+
}, [packages, selectedPlanId, setSelectedPlanId]);
|
|
41
|
+
|
|
35
42
|
const handleLegalUrl = useCallback(async (url: string | undefined) => {
|
|
36
43
|
if (!url) return;
|
|
37
44
|
try {
|
|
@@ -53,8 +60,8 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo((props) => {
|
|
|
53
60
|
<ScreenLayout scrollable={true} edges={[]} backgroundColor="transparent" contentContainerStyle={styles.scroll}>
|
|
54
61
|
{heroImage && <View style={styles.heroContainer}><Image source={heroImage} style={styles.heroImage} contentFit="cover" transition={0} /></View>}
|
|
55
62
|
<View style={styles.header}>
|
|
56
|
-
<AtomicText type="headlineMedium" style={[styles.title, { color: tokens.colors.textPrimary }]}>{translations.title}</AtomicText>
|
|
57
|
-
{translations.subtitle && <AtomicText type="bodyMedium" style={[styles.subtitle, { color: tokens.colors.textSecondary }]}>{translations.subtitle}</AtomicText>}
|
|
63
|
+
<AtomicText type="headlineMedium" adjustsFontSizeToFit numberOfLines={2} minimumFontScale={0.75} style={[styles.title, { color: tokens.colors.textPrimary }]}>{translations.title}</AtomicText>
|
|
64
|
+
{translations.subtitle && <AtomicText type="bodyMedium" adjustsFontSizeToFit numberOfLines={3} minimumFontScale={0.8} style={[styles.subtitle, { color: tokens.colors.textSecondary }]}>{translations.subtitle}</AtomicText>}
|
|
58
65
|
</View>
|
|
59
66
|
<PaywallFeatures features={features} />
|
|
60
67
|
<View style={styles.plans}>
|
|
@@ -78,7 +85,7 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo((props) => {
|
|
|
78
85
|
|
|
79
86
|
{/* Sticky footer — always visible, never hidden behind scroll content */}
|
|
80
87
|
<View style={[styles.stickyFooter, { paddingBottom: Math.max(insets.bottom, 16) }]}>
|
|
81
|
-
<TouchableOpacity onPress={handlePurchase} disabled={isProcessing || isLoadingPackages} style={[styles.cta, { backgroundColor: tokens.colors.primary }, (isProcessing || isLoadingPackages) && styles.ctaDisabled]} activeOpacity={0.75}>
|
|
88
|
+
<TouchableOpacity onPress={handlePurchase} disabled={isProcessing || isLoadingPackages || !selectedPlanId} style={[styles.cta, { backgroundColor: tokens.colors.primary }, (isProcessing || isLoadingPackages || !selectedPlanId) && styles.ctaDisabled]} activeOpacity={0.75}>
|
|
82
89
|
<AtomicText type="titleLarge" style={[styles.ctaText, { color: tokens.colors.onPrimary }]}>{isProcessing ? translations.processingText : translations.purchaseButtonText}</AtomicText>
|
|
83
90
|
</TouchableOpacity>
|
|
84
91
|
<PaywallFooter translations={translations} legalUrls={legalUrls} isProcessing={isProcessing} onRestore={onRestore ? handleRestore : undefined} onLegalClick={handleLegalUrl} />
|
|
@@ -28,13 +28,13 @@ export const PlanCard: React.FC<PlanCardProps> = React.memo(
|
|
|
28
28
|
{isSelected && <AtomicIcon name="checkmark-circle-outline" customSize={12} customColor={tokens.colors.onPrimary} />}
|
|
29
29
|
</View>
|
|
30
30
|
<View style={styles.textSection}>
|
|
31
|
-
<AtomicText type="titleSmall" style={{ color: tokens.colors.textPrimary, fontWeight: "600" }}>{title}</AtomicText>
|
|
31
|
+
<AtomicText type="titleSmall" numberOfLines={2} style={{ color: tokens.colors.textPrimary, fontWeight: "600" }}>{title}</AtomicText>
|
|
32
32
|
{creditAmount != null && creditAmount > 0 && creditsLabel && (
|
|
33
33
|
<AtomicText type="bodySmall" style={{ color: tokens.colors.textSecondary }}>{creditAmount} {creditsLabel}</AtomicText>
|
|
34
34
|
)}
|
|
35
35
|
</View>
|
|
36
36
|
</View>
|
|
37
|
-
<AtomicText type="titleMedium" style={{ color: isSelected ? tokens.colors.primary : tokens.colors.textPrimary, fontWeight: "700", fontSize: 18 }}>{price}</AtomicText>
|
|
37
|
+
<AtomicText type="titleMedium" numberOfLines={1} adjustsFontSizeToFit minimumFontScale={0.8} style={{ color: isSelected ? tokens.colors.primary : tokens.colors.textPrimary, fontWeight: "700", fontSize: 18, flexShrink: 0 }}>{price}</AtomicText>
|
|
38
38
|
</View>
|
|
39
39
|
</View>
|
|
40
40
|
</TouchableOpacity>
|