@umituz/react-native-subscription 2.24.9 → 2.24.11
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.24.
|
|
3
|
+
"version": "2.24.11",
|
|
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",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import { View, TouchableOpacity, StyleSheet
|
|
7
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
8
|
import { AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
9
|
import type { PaywallTabType } from '../entities';
|
|
10
10
|
|
|
@@ -18,18 +18,7 @@ interface PaywallTabBarProps {
|
|
|
18
18
|
export const PaywallTabBar: React.FC<PaywallTabBarProps> = React.memo(
|
|
19
19
|
({ activeTab, onTabChange, creditsLabel, subscriptionLabel }) => {
|
|
20
20
|
const tokens = useAppDesignTokens();
|
|
21
|
-
const
|
|
22
|
-
new Animated.Value(activeTab === "credits" ? 0 : 1)
|
|
23
|
-
).current;
|
|
24
|
-
|
|
25
|
-
React.useEffect(() => {
|
|
26
|
-
Animated.spring(animatedValue, {
|
|
27
|
-
toValue: activeTab === "credits" ? 0 : 1,
|
|
28
|
-
useNativeDriver: false,
|
|
29
|
-
tension: 68,
|
|
30
|
-
friction: 12,
|
|
31
|
-
}).start();
|
|
32
|
-
}, [activeTab, animatedValue]);
|
|
21
|
+
const isCreditsActive = activeTab === "credits";
|
|
33
22
|
|
|
34
23
|
const renderTab = (tab: PaywallTabType, label: string) => {
|
|
35
24
|
const isActive = activeTab === tab;
|
|
@@ -37,7 +26,10 @@ export const PaywallTabBar: React.FC<PaywallTabBarProps> = React.memo(
|
|
|
37
26
|
return (
|
|
38
27
|
<TouchableOpacity
|
|
39
28
|
key={tab}
|
|
40
|
-
style={
|
|
29
|
+
style={[
|
|
30
|
+
styles.tab,
|
|
31
|
+
isActive ? { backgroundColor: tokens.colors.surface } : undefined,
|
|
32
|
+
]}
|
|
41
33
|
onPress={() => onTabChange(tab)}
|
|
42
34
|
activeOpacity={0.7}
|
|
43
35
|
>
|
|
@@ -54,16 +46,8 @@ export const PaywallTabBar: React.FC<PaywallTabBarProps> = React.memo(
|
|
|
54
46
|
);
|
|
55
47
|
};
|
|
56
48
|
|
|
57
|
-
const indicatorLeft = animatedValue.interpolate({
|
|
58
|
-
inputRange: [0, 1],
|
|
59
|
-
outputRange: ["2%", "50%"],
|
|
60
|
-
});
|
|
61
|
-
|
|
62
49
|
return (
|
|
63
50
|
<View style={[styles.container, { backgroundColor: tokens.colors.surfaceSecondary }]}>
|
|
64
|
-
<Animated.View
|
|
65
|
-
style={[styles.indicator, { backgroundColor: tokens.colors.surface, left: indicatorLeft }] as any}
|
|
66
|
-
/>
|
|
67
51
|
{renderTab("credits", creditsLabel)}
|
|
68
52
|
{renderTab("subscription", subscriptionLabel)}
|
|
69
53
|
</View>
|
|
@@ -80,21 +64,13 @@ const styles = StyleSheet.create({
|
|
|
80
64
|
padding: 4,
|
|
81
65
|
marginHorizontal: 24,
|
|
82
66
|
marginBottom: 16,
|
|
83
|
-
position: "relative",
|
|
84
67
|
height: 44,
|
|
85
68
|
},
|
|
86
|
-
indicator: {
|
|
87
|
-
position: "absolute",
|
|
88
|
-
top: 4,
|
|
89
|
-
bottom: 4,
|
|
90
|
-
width: "46%",
|
|
91
|
-
borderRadius: 8,
|
|
92
|
-
},
|
|
93
69
|
tab: {
|
|
94
70
|
flex: 1,
|
|
95
71
|
alignItems: "center",
|
|
96
72
|
justifyContent: "center",
|
|
97
|
-
|
|
73
|
+
borderRadius: 8,
|
|
98
74
|
},
|
|
99
75
|
tabText: {
|
|
100
76
|
fontWeight: "600",
|