@stigg/react-sdk 3.0.0 → 3.0.2
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/README.md +4 -4
- package/dist/components/paywall/PlanEntitlements.d.ts +3 -1
- package/dist/react-sdk.cjs.development.js +20 -14
- 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 +20 -14
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/paywall/PlanEntitlements.tsx +11 -3
- package/src/components/paywall/PlanOffering.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from '@emotion/styled/macro';
|
|
3
|
-
import { WidgetType } from '@stigg/js-client-sdk';
|
|
3
|
+
import { BillingPeriod, WidgetType } from '@stigg/js-client-sdk';
|
|
4
4
|
import { EntitlementRow } from './EntitlementRow';
|
|
5
5
|
import { PaywallPlan } from './types';
|
|
6
6
|
import { PaywallLocalization } from './paywallTextOverrides';
|
|
@@ -26,8 +26,16 @@ function getTitle(plan: PaywallPlan, paywallLocale: PaywallLocalization) {
|
|
|
26
26
|
return title;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export function PlanEntitlements({
|
|
30
|
-
|
|
29
|
+
export function PlanEntitlements({
|
|
30
|
+
plan,
|
|
31
|
+
billingPeriod,
|
|
32
|
+
paywallLocale,
|
|
33
|
+
}: {
|
|
34
|
+
plan: PaywallPlan;
|
|
35
|
+
billingPeriod: BillingPeriod;
|
|
36
|
+
paywallLocale: PaywallLocalization;
|
|
37
|
+
}) {
|
|
38
|
+
const prices = plan.pricePoints?.filter(price => price.billingPeriod === billingPeriod);
|
|
31
39
|
const unitBasedEntitlements = prices?.map(price => {
|
|
32
40
|
const shouldRenderUnitBasedEntitlement =
|
|
33
41
|
(price?.minUnitQuantity && price?.minUnitQuantity > 1) || price?.maxUnitQuantity;
|
|
@@ -257,7 +257,7 @@ export function PlanOffering({
|
|
|
257
257
|
<Divider className="stigg-plan-header-divider" $withMargin={!shouldShowDescriptionSection} />
|
|
258
258
|
</HeaderWrapper>
|
|
259
259
|
|
|
260
|
-
<PlanEntitlements plan={plan} paywallLocale={paywallLocale} />
|
|
260
|
+
<PlanEntitlements plan={plan} billingPeriod={billingPeriod} paywallLocale={paywallLocale} />
|
|
261
261
|
|
|
262
262
|
<PlanOfferingButton
|
|
263
263
|
isNextPlan={isNextPlan}
|