@umituz/react-native-subscription 2.35.6 → 2.35.7
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.35.
|
|
3
|
+
"version": "2.35.7",
|
|
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",
|
package/src/domains/subscription/presentation/screens/components/SubscriptionHeaderContent.tsx
CHANGED
|
@@ -2,22 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { DetailRow } from "../../components/details/DetailRow";
|
|
4
4
|
import type { SubscriptionHeaderProps } from "./SubscriptionHeader.types";
|
|
5
|
+
import { formatPackageTypeForDisplay } from "../../../../subscription/utils/packageTypeFormatter";
|
|
5
6
|
|
|
6
7
|
declare const __DEV__: boolean;
|
|
7
8
|
|
|
8
|
-
function formatSubscriptionPeriod(packageType: string | null | undefined, periodType: string | null | undefined): string {
|
|
9
|
-
if (packageType) {
|
|
10
|
-
const formatted = packageType.toLowerCase().replace(/_/g, ' ');
|
|
11
|
-
return formatted.charAt(0).toUpperCase() + formatted.slice(1);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (periodType === "NORMAL") {
|
|
15
|
-
return "Standard";
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return periodType || "Unknown";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
9
|
interface SubscriptionHeaderContentProps {
|
|
22
10
|
isLifetime: boolean;
|
|
23
11
|
showExpirationDate: boolean;
|
|
@@ -93,10 +81,10 @@ export const SubscriptionHeaderContent: React.FC<SubscriptionHeaderContentProps>
|
|
|
93
81
|
valueStyle={styles.value}
|
|
94
82
|
/>
|
|
95
83
|
)}
|
|
96
|
-
{
|
|
84
|
+
{packageType && translations.periodTypeLabel && (
|
|
97
85
|
<DetailRow
|
|
98
86
|
label={translations.periodTypeLabel}
|
|
99
|
-
value={
|
|
87
|
+
value={formatPackageTypeForDisplay(packageType)}
|
|
100
88
|
style={styles.row}
|
|
101
89
|
labelStyle={styles.label}
|
|
102
90
|
valueStyle={styles.value}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PackageType } from "../../revenuecat/core/types";
|
|
2
|
+
|
|
3
|
+
export function formatPackageTypeForDisplay(packageType: PackageType | string | null | undefined): string {
|
|
4
|
+
if (!packageType) {
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const formatted = packageType.toLowerCase().replace(/_/g, " ");
|
|
9
|
+
return formatted.charAt(0).toUpperCase() + formatted.slice(1);
|
|
10
|
+
}
|