@umituz/react-native-subscription 2.27.119 → 2.27.121

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.121",
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
@@ -98,6 +122,7 @@ export const SubscriptionDetailScreen: React.FC<
98
122
  expirationDate={config.expirationDate}
99
123
  purchaseDate={config.purchaseDate}
100
124
  daysRemaining={config.daysRemaining}
125
+ hideTitle={!!config.onClose}
101
126
  translations={config.translations}
102
127
  />
103
128
  )}
@@ -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 && (
@@ -16,6 +16,7 @@ export interface SubscriptionHeaderProps {
16
16
  expirationDate?: string;
17
17
  purchaseDate?: string;
18
18
  daysRemaining?: number | null;
19
+ hideTitle?: boolean;
19
20
  translations: {
20
21
  title: string;
21
22
  statusActive: string;
@@ -36,6 +37,7 @@ export const SubscriptionHeader: React.FC<SubscriptionHeaderProps> = ({
36
37
  expirationDate,
37
38
  purchaseDate,
38
39
  daysRemaining,
40
+ hideTitle,
39
41
  translations,
40
42
  }) => {
41
43
  const tokens = useAppDesignTokens();
@@ -87,14 +89,16 @@ export const SubscriptionHeader: React.FC<SubscriptionHeaderProps> = ({
87
89
  return (
88
90
  <View style={styles.container}>
89
91
  <View style={styles.header}>
90
- <View style={styles.titleContainer}>
91
- <AtomicText
92
- type="headlineSmall"
93
- style={[styles.title, { color: tokens.colors.textPrimary }]}
94
- >
95
- {translations.title}
96
- </AtomicText>
97
- </View>
92
+ {!hideTitle && (
93
+ <View style={styles.titleContainer}>
94
+ <AtomicText
95
+ type="headlineSmall"
96
+ style={[styles.title, { color: tokens.colors.textPrimary }]}
97
+ >
98
+ {translations.title}
99
+ </AtomicText>
100
+ </View>
101
+ )}
98
102
  <PremiumStatusBadge
99
103
  status={statusType}
100
104
  activeLabel={translations.statusActive}