@stigg/react-sdk 5.23.0 → 5.23.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/dist/components/utils/formatNumber.d.ts +1 -0
- package/dist/react-sdk.cjs.development.js +15 -15
- 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 +15 -15
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/common/VolumeBulkSelect.tsx +2 -1
- package/src/components/paywall/EntitlementRow.tsx +2 -7
- package/src/components/utils/formatNumber.ts +5 -0
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { map } from 'lodash';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Typography } from './Typography';
|
|
9
9
|
import { TiersSelectContainerProps } from './TiersSelectContainer';
|
|
10
|
+
import { formatNumber } from '../utils/formatNumber';
|
|
10
11
|
|
|
11
12
|
const TierSelect = styled(Select)`
|
|
12
13
|
border-radius: 10px;
|
|
@@ -62,7 +63,7 @@ export function VolumeBulkSelect({
|
|
|
62
63
|
{map(tiers, (tier: PriceTierFragment) => (
|
|
63
64
|
<MenuItem className="stigg-price-tier-menu-item-text" key={tier.upTo} value={tier.upTo?.toString()}>
|
|
64
65
|
<Typography variant="body1" color="primary" style={{ lineHeight: 'unset' }}>
|
|
65
|
-
{tier.upTo} {tierUnits}
|
|
66
|
+
{formatNumber(tier.upTo)} {tierUnits}
|
|
66
67
|
</Typography>
|
|
67
68
|
</MenuItem>
|
|
68
69
|
))}
|
|
@@ -3,6 +3,7 @@ import styled from '@emotion/styled/macro';
|
|
|
3
3
|
import { EntitlementResetPeriod } from '@stigg/js-client-sdk';
|
|
4
4
|
import CheckUrl from '../../assets/check-stigg.svg';
|
|
5
5
|
import { calculateUnitQuantityText } from './utils/calculateUnitQuantityText';
|
|
6
|
+
import { formatNumber } from '../utils/formatNumber';
|
|
6
7
|
import { Typography } from '../common/Typography';
|
|
7
8
|
|
|
8
9
|
const EntitlementName = styled(Typography)`
|
|
@@ -29,12 +30,6 @@ const EntitlementCheckIcon = styled(CheckUrl)`
|
|
|
29
30
|
}
|
|
30
31
|
`;
|
|
31
32
|
|
|
32
|
-
function formatUsageNumber(usageLimit: number) {
|
|
33
|
-
return usageLimit.toLocaleString('en-US', {
|
|
34
|
-
maximumFractionDigits: 0,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
33
|
type EntitlementRowProps = {
|
|
39
34
|
hasUnlimitedUsage?: boolean | null;
|
|
40
35
|
isCustom?: boolean | null;
|
|
@@ -100,7 +95,7 @@ function getEntitlementDisplay({
|
|
|
100
95
|
|
|
101
96
|
if (usageLimit) {
|
|
102
97
|
const featureUnits = usageLimit === 1 ? feature?.units : feature?.unitsPlural;
|
|
103
|
-
return `${
|
|
98
|
+
return `${formatNumber(usageLimit)} ${featureUnits} ${resetPeriodSuffix}`;
|
|
104
99
|
}
|
|
105
100
|
|
|
106
101
|
if (unitBasedEntitlement) {
|