@umituz/react-native-subscription 2.27.119 → 2.27.120

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.27.119",
3
+ "version": "2.27.120",
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",
@@ -8,7 +8,10 @@ import React, { useMemo } from "react";
8
8
  import { StyleSheet, View } from "react-native";
9
9
  import {
10
10
  useAppDesignTokens,
11
+ NavigationHeader,
12
+ AtomicIcon,
11
13
  } from "@umituz/react-native-design-system";
14
+ import { Pressable } from "react-native";
12
15
  import { ScreenLayout } from "../../../../shared/presentation";
13
16
  import { SubscriptionHeader } from "./components/SubscriptionHeader";
14
17
  import { CreditsList, type CreditItem } from "./components/CreditsList";
@@ -55,6 +58,7 @@ export interface SubscriptionDetailConfig {
55
58
  credits?: readonly CreditItem[];
56
59
  translations: SubscriptionDetailTranslations;
57
60
  upgradePrompt?: UpgradePromptConfig;
61
+ onClose?: () => void;
58
62
  }
59
63
 
60
64
  export interface SubscriptionDetailScreenProps {
@@ -85,10 +89,30 @@ export const SubscriptionDetailScreen: React.FC<
85
89
  return (
86
90
  <ScreenLayout
87
91
  scrollable={true}
88
- edges={["bottom"]}
92
+ edges={config.onClose ? ["bottom"] : ["top", "bottom"]}
89
93
  backgroundColor={tokens.colors.backgroundPrimary}
90
94
  contentContainerStyle={styles.content}
91
95
  >
96
+ {config.onClose && (
97
+ <NavigationHeader
98
+ title={config.translations.title}
99
+ rightElement={
100
+ <Pressable
101
+ onPress={config.onClose}
102
+ style={({ pressed }) => ({
103
+ width: 44,
104
+ height: 44,
105
+ justifyContent: "center",
106
+ alignItems: "center",
107
+ backgroundColor: pressed ? tokens.colors.surfaceVariant : tokens.colors.surface,
108
+ borderRadius: tokens.radius.full,
109
+ })}
110
+ >
111
+ <AtomicIcon name="close-outline" customSize={24} color="textPrimary" />
112
+ </Pressable>
113
+ }
114
+ />
115
+ )}
92
116
  <View style={styles.cardsContainer}>
93
117
  {showHeader && (
94
118
  <SubscriptionHeader
@@ -52,6 +52,8 @@ export const CreditsList: React.FC<CreditsListProps> = ({
52
52
  [tokens]
53
53
  );
54
54
 
55
+ if (!credits || credits.length === 0) return null;
56
+
55
57
  return (
56
58
  <View style={styles.container}>
57
59
  {title && (