@stigg/react-sdk 3.0.0-beta.9 → 3.0.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,5 +1,5 @@
1
1
  {
2
- "version": "3.0.0-beta.9",
2
+ "version": "3.0.1",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -101,5 +101,5 @@
101
101
  "styled-typography": "^1.0.3"
102
102
  },
103
103
  "readme": "ERROR: No README data found!",
104
- "_id": "@stigg/react-sdk@3.0.0-beta.0"
104
+ "_id": "@stigg/react-sdk@0.18.0"
105
105
  }
@@ -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({ plan, paywallLocale }: { plan: PaywallPlan; paywallLocale: PaywallLocalization }) {
30
- const prices = plan.pricePoints;
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}