@umituz/react-native-subscription 2.18.0 → 2.18.1

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.18.0",
3
+ "version": "2.18.1",
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
  * Package-driven: all logic handled internally
5
5
  */
6
6
 
7
- import { useMemo } from "react";
7
+ import { useMemo, useCallback } from "react";
8
8
  import { useCredits } from "./useCredits";
9
9
  import { useSubscriptionStatus } from "./useSubscriptionStatus";
10
10
  import { useCustomerInfo } from "../../revenuecat/presentation/hooks/useCustomerInfo";
@@ -55,6 +55,10 @@ export const useSubscriptionSettingsConfig = (
55
55
  const { customerInfo } = useCustomerInfo();
56
56
  const { openPaywall } = usePaywallVisibility();
57
57
 
58
+ const handleOpenPaywall = useCallback(() => {
59
+ openPaywall("settings");
60
+ }, [openPaywall]);
61
+
58
62
  // RevenueCat entitlement info - dynamically using configured entitlementId
59
63
  const entitlementId = SubscriptionManager.getEntitlementId() || "premium";
60
64
  const premiumEntitlement = customerInfo?.entitlements.active[entitlementId];
@@ -137,7 +141,7 @@ export const useSubscriptionSettingsConfig = (
137
141
  ? translations.statusActive
138
142
  : translations.statusFree,
139
143
  icon: "diamond",
140
- onPress: openPaywall,
144
+ onPress: handleOpenPaywall,
141
145
  },
142
146
  sectionConfig: {
143
147
  statusType,
@@ -163,7 +167,7 @@ export const useSubscriptionSettingsConfig = (
163
167
  manageButton: translations.manageButton,
164
168
  upgradeButton: translations.upgradeButton,
165
169
  },
166
- onUpgrade: openPaywall,
170
+ onUpgrade: handleOpenPaywall,
167
171
  upgradePrompt,
168
172
  },
169
173
  }),
@@ -177,7 +181,7 @@ export const useSubscriptionSettingsConfig = (
177
181
  daysRemaining,
178
182
  willRenew,
179
183
  creditsArray,
180
- openPaywall,
184
+ handleOpenPaywall,
181
185
  upgradePrompt,
182
186
  ]
183
187
  );