@umituz/react-native-subscription 3.1.26 → 3.1.27

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": "3.1.26",
3
+ "version": "3.1.27",
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",
@@ -7,15 +7,16 @@ import React from "react";
7
7
  import { View } from "react-native";
8
8
  import type { ImageSourcePropType } from "react-native";
9
9
  import { AtomicText, AtomicIcon } from "@umituz/react-native-design-system/atoms";
10
+ import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
10
11
  import { Image } from "expo-image";
11
12
  import { PlanCard } from "./PlanCard";
12
13
  import type { PaywallListItem } from "../utils/paywallLayoutUtils";
14
+ import type { PaywallTranslations } from "../entities/types";
13
15
  import { paywallScreenStyles as styles } from "./PaywallScreen.styles";
14
16
 
15
17
  interface PaywallRenderItemProps {
16
18
  item: PaywallListItem;
17
- tokens: any;
18
- translations: any;
19
+ translations: PaywallTranslations;
19
20
  heroImage?: ImageSourcePropType;
20
21
  selectedPlanId?: string;
21
22
  bestValueIdentifier?: string;
@@ -26,7 +27,6 @@ interface PaywallRenderItemProps {
26
27
 
27
28
  export const PaywallRenderItem: React.FC<PaywallRenderItemProps> = React.memo(({
28
29
  item,
29
- tokens,
30
30
  translations,
31
31
  heroImage,
32
32
  selectedPlanId,
@@ -35,6 +35,8 @@ export const PaywallRenderItem: React.FC<PaywallRenderItemProps> = React.memo(({
35
35
  creditsLabel,
36
36
  onSelectPlan,
37
37
  }) => {
38
+ const tokens = useAppDesignTokens();
39
+
38
40
  if (!translations) return null;
39
41
 
40
42
  switch (item.type) {
@@ -73,7 +75,7 @@ export const PaywallRenderItem: React.FC<PaywallRenderItemProps> = React.memo(({
73
75
 
74
76
  case 'FEATURE':
75
77
  return (
76
- <View key={`feat-${item.feature.text}`} style={[styles.featureRow, { marginHorizontal: 24, marginBottom: 16 }]}>
78
+ <View key={`feat-${item.feature.text}`} style={styles.featureRow}>
77
79
  <View style={[styles.featureIcon, { backgroundColor: tokens.colors.primary }]}>
78
80
  <AtomicIcon name={item.feature.icon} customSize={16} customColor={tokens.colors.onPrimary} />
79
81
  </View>
@@ -61,6 +61,8 @@ export const paywallScreenStyles = StyleSheet.create({
61
61
  flexDirection: "row",
62
62
  alignItems: "center",
63
63
  gap: 14,
64
+ marginHorizontal: 24,
65
+ marginBottom: 16,
64
66
  },
65
67
  featureIcon: {
66
68
  width: 30,
@@ -30,6 +30,10 @@ import {
30
30
  import { hasItems } from "../../../shared/utils/arrayUtils";
31
31
  import { PaywallRenderItem } from "./PaywallScreen.renderItem";
32
32
 
33
+ // Paywall layout constants
34
+ const PAYWALL_HEADER_HEIGHT = 60; // Close button + spacing
35
+ const PAYWALL_FOOTER_HEIGHT_BASE = 280; // Base footer height
36
+
33
37
  export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) => {
34
38
  const navigation = useNavigation();
35
39
 
@@ -148,7 +152,6 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
148
152
  return (
149
153
  <PaywallRenderItem
150
154
  item={item}
151
- tokens={tokens}
152
155
  translations={translations}
153
156
  heroImage={heroImage}
154
157
  selectedPlanId={selectedPlanId ?? undefined}
@@ -158,7 +161,7 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
158
161
  onSelectPlan={setSelectedPlanId}
159
162
  />
160
163
  );
161
- }, [tokens, translations, heroImage, selectedPlanId, bestValueIdentifier, creditAmounts, creditsLabel, setSelectedPlanId]);
164
+ }, [translations, heroImage, selectedPlanId, bestValueIdentifier, creditAmounts, creditsLabel, setSelectedPlanId]);
162
165
 
163
166
  // Performance Optimization: getItemLayout for FlatList
164
167
  const getItemLayout = useCallback((_data: ArrayLike<PaywallListItem> | null | undefined, index: number) => {
@@ -222,8 +225,8 @@ export const PaywallScreen: React.FC<PaywallScreenProps> = React.memo((props) =>
222
225
  contentContainerStyle={[
223
226
  styles.listContent,
224
227
  {
225
- paddingTop: Math.max(insets.top, 20) + 60, // Responsive header spacing
226
- paddingBottom: 280 + responsive.verticalPadding, // Dynamic footer spacing
228
+ paddingTop: Math.max(insets.top, 20) + PAYWALL_HEADER_HEIGHT, // Responsive header spacing
229
+ paddingBottom: PAYWALL_FOOTER_HEIGHT_BASE + responsive.verticalPadding, // Dynamic footer spacing
227
230
  paddingHorizontal: responsive.horizontalPadding, // Device-based horizontal padding
228
231
  }
229
232
  ]}