@stigg/react-sdk 4.3.0 → 4.3.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.
@@ -1048,7 +1048,8 @@ function getPaidPriceText(_ref) {
1048
1048
  selectedBillingPeriod = _ref.selectedBillingPeriod,
1049
1049
  locale = _ref.locale,
1050
1050
  shouldShowMonthlyPriceAmount = _ref.shouldShowMonthlyPriceAmount,
1051
- selectedTierByFeature = _ref.selectedTierByFeature;
1051
+ selectedTierByFeature = _ref.selectedTierByFeature,
1052
+ paywallLocale = _ref.paywallLocale;
1052
1053
 
1053
1054
  var _ref2 = paywallCalculatedPrice || planPrices[0],
1054
1055
  amount = _ref2.amount,
@@ -1059,7 +1060,8 @@ function getPaidPriceText(_ref) {
1059
1060
  var priceNumber = selectedBillingPeriod === BillingPeriod.Annually && shouldShowMonthlyPriceAmount ? priceAmount / 12 : priceAmount;
1060
1061
  var tiers;
1061
1062
  var tierUnits;
1062
- var unit = shouldShowMonthlyPriceAmount ? '/ month' : '/ year';
1063
+ var pricePeriod = paywallLocale.price.pricePeriod(shouldShowMonthlyPriceAmount ? BillingPeriod.Monthly : BillingPeriod.Annually);
1064
+ var unit = pricePeriod;
1063
1065
 
1064
1066
  for (var _iterator = _createForOfIteratorHelperLoose(planPrices), _step; !(_step = _iterator()).done;) {
1065
1067
  var _price = _step.value;
@@ -1084,7 +1086,7 @@ function getPaidPriceText(_ref) {
1084
1086
  var featureUnit = ((_price$feature = price.feature) == null ? void 0 : _price$feature.units) || '';
1085
1087
 
1086
1088
  if (price.pricingModel === BillingModel.PerUnit && !price.isTieredPrice) {
1087
- unit = shouldShowMonthlyPriceAmount ? "per " + featureUnit + " / month" : "per " + featureUnit + " / year";
1089
+ unit = shouldShowMonthlyPriceAmount ? "per " + featureUnit + " " + pricePeriod : "per " + featureUnit + " " + pricePeriod;
1088
1090
  } else if (price.pricingModel === BillingModel.UsageBased) {
1089
1091
  unit = "per " + featureUnit;
1090
1092
  }
@@ -1143,7 +1145,8 @@ function getPlanPrice(plan, billingPeriod, paywallLocale, locale, shouldShowMont
1143
1145
  plan: plan
1144
1146
  })) : getPaidPriceText(_extends({}, paidParams, {
1145
1147
  locale: locale,
1146
- shouldShowMonthlyPriceAmount: shouldShowMonthlyPriceAmount
1148
+ shouldShowMonthlyPriceAmount: shouldShowMonthlyPriceAmount,
1149
+ paywallLocale: paywallLocale
1147
1150
  }));
1148
1151
  }
1149
1152
 
@@ -3351,6 +3354,9 @@ function getResolvedPaywallLocalize(localizeOverride) {
3351
3354
  },
3352
3355
  price: {
3353
3356
  startingAtCaption: 'Starts at',
3357
+ pricePeriod: function pricePeriod(billingPeriod) {
3358
+ return billingPeriod === BillingPeriod.Monthly ? '/ month' : '/ year';
3359
+ },
3354
3360
  free: function free(currency) {
3355
3361
  return {
3356
3362
  price: (currency == null ? void 0 : currency.symbol) + "0"