@stigg/react-sdk 5.24.0 → 5.25.0
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/dist/components/customerPortal/subscriptionOverview/charges/ChargeItem.d.ts +2 -1
- package/dist/react-sdk.cjs.development.js +5 -2
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +5 -2
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/customerPortal/subscriptionOverview/charges/ChargeItem.tsx +4 -1
- package/src/components/customerPortal/subscriptionOverview/charges/ChargeList.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.
|
|
2
|
+
"version": "5.25.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"@emotion/react": "^11.10.5",
|
|
115
115
|
"@emotion/styled": "^11.10.5",
|
|
116
116
|
"@mui/material": "^5.12.0",
|
|
117
|
-
"@stigg/js-client-sdk": "3.
|
|
117
|
+
"@stigg/js-client-sdk": "3.33.0",
|
|
118
118
|
"@stripe/react-stripe-js": "^2.1.1",
|
|
119
119
|
"@stripe/stripe-js": "^1.54.1",
|
|
120
120
|
"@types/styled-components": "^5.1.26",
|
|
@@ -13,6 +13,7 @@ export type UsageBasedChargeProps = {
|
|
|
13
13
|
entitlement: Exclude<CustomerPortalEntitlement, 'feature'>;
|
|
14
14
|
feature: FeatureFragment;
|
|
15
15
|
amount: number;
|
|
16
|
+
blockSize?: number | null;
|
|
16
17
|
currency: Currency;
|
|
17
18
|
onBuyMore?: OnBuyMoreCallbackFn;
|
|
18
19
|
onManageSubscription: OnManageClick;
|
|
@@ -24,6 +25,7 @@ export type UsageBasedChargeProps = {
|
|
|
24
25
|
export function ChargeItem({
|
|
25
26
|
amount,
|
|
26
27
|
currency,
|
|
28
|
+
blockSize,
|
|
27
29
|
entitlement,
|
|
28
30
|
feature,
|
|
29
31
|
hideChargePrice,
|
|
@@ -43,7 +45,8 @@ export function ChargeItem({
|
|
|
43
45
|
</LongText>
|
|
44
46
|
{!hideChargePrice && (
|
|
45
47
|
<LongText variant="body1" color="secondary">
|
|
46
|
-
{currencyPriceFormatter({ amount, currency })} per {
|
|
48
|
+
{currencyPriceFormatter({ amount, currency })} per {blockSize ? `${blockSize} ` : ''}
|
|
49
|
+
{blockSize ? feature.featureUnitsPlural : feature.featureUnits}
|
|
47
50
|
</LongText>
|
|
48
51
|
)}
|
|
49
52
|
</div>
|
|
@@ -34,7 +34,7 @@ export function ChargeList({
|
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<div className="stigg-charge-list" style={{ display: 'flex', flexDirection: 'column', gap: 16, marginTop: 32 }}>
|
|
37
|
-
{filteredSubscriptionPrices.map(({ feature, price, billingModel }) => {
|
|
37
|
+
{filteredSubscriptionPrices.map(({ feature, price, blockSize, billingModel }) => {
|
|
38
38
|
if (!feature || !price) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
@@ -51,6 +51,7 @@ export function ChargeList({
|
|
|
51
51
|
entitlement={entitlement}
|
|
52
52
|
feature={entitlement.feature}
|
|
53
53
|
amount={price.amount}
|
|
54
|
+
blockSize={blockSize}
|
|
54
55
|
currency={price.currency}
|
|
55
56
|
hideChargePrice={billingModel === BillingModel.PerUnit}
|
|
56
57
|
onBuyMore={onBuyMore}
|