pcm-shared-components 0.0.220 → 0.0.222
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.
|
@@ -27,11 +27,12 @@ const platformPricingIcons = [mdiShimmer, mdiFire, mdiTorch];
|
|
|
27
27
|
export const PlatformPaymentPlans = props => {
|
|
28
28
|
const {
|
|
29
29
|
platformPlanFeatures,
|
|
30
|
-
|
|
30
|
+
platformPricingModels,
|
|
31
31
|
onClickPlanSelection,
|
|
32
32
|
showSaveUptoPromo,
|
|
33
33
|
theme
|
|
34
34
|
} = props;
|
|
35
|
+
console.log('debug Platform payment plans:', props);
|
|
35
36
|
const planTypeDescriptions = [i18next.t('platform_plan_feature.plan_type_descriptions.free'), i18next.t('platform_plan_feature.plan_type_descriptions.standard'), i18next.t('platform_plan_feature.plan_type_descriptions.premium')];
|
|
36
37
|
const compTheme = theme ? theme : useTheme();
|
|
37
38
|
const defaultTheme = createTheme(compTheme); //---------------------------------------------------
|
|
@@ -54,7 +55,7 @@ export const PlatformPaymentPlans = props => {
|
|
|
54
55
|
//Returns an array with the unique ids that we have for the billing_period_id.
|
|
55
56
|
//This will allow us to determine if we need to display the monthly/yearly toggle button and which billing period id to use as the default
|
|
56
57
|
try {
|
|
57
|
-
const billingPeriodIds = [...new Set(
|
|
58
|
+
const billingPeriodIds = [...new Set(platformPricingModels.map(item => item.billing_period_id))].sort((a, b) => a - b);
|
|
58
59
|
setSelectedBillingPeriod(Number(billingPeriodIds[0]));
|
|
59
60
|
setHasMonthlyAndYearlyBillingPeriod(billingPeriodIds.length > 1);
|
|
60
61
|
} catch (error) {
|
|
@@ -258,14 +259,14 @@ export const PlatformPaymentPlans = props => {
|
|
|
258
259
|
}
|
|
259
260
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
260
261
|
className: "flex flex-wrap justify-center max-w-max mx-auto pt-12"
|
|
261
|
-
},
|
|
262
|
+
}, platformPricingModels.filter(price => Number(price.billing_period_id) === selectedBillingPeriod).map((model, idx) => /*#__PURE__*/React.createElement(PriceCard, _extends({
|
|
262
263
|
key: `price_card_${idx}`
|
|
263
264
|
}, model))))));
|
|
264
265
|
};
|
|
265
266
|
export default PlatformPaymentPlans;
|
|
266
267
|
PlatformPaymentPlans.defaultProps = {
|
|
267
268
|
platformPlanFeatures: [],
|
|
268
|
-
|
|
269
|
+
platformPricingModels: [],
|
|
269
270
|
onClickPlanSelection: () => {},
|
|
270
271
|
showSaveUptoPromo: true,
|
|
271
272
|
theme: undefined
|
|
@@ -277,12 +278,12 @@ PlatformPaymentPlans.propTypes = {
|
|
|
277
278
|
/** This is the platform features that are activated for each pricing model tier */
|
|
278
279
|
platformPlanFeatures: PropTypes.array,
|
|
279
280
|
|
|
280
|
-
/** This is the individual pricing models that are offered to our clients*/
|
|
281
|
-
|
|
281
|
+
/** This is the individual pricing models that are offered to our clients */
|
|
282
|
+
platformPricingModels: PropTypes.array.isRequired,
|
|
282
283
|
|
|
283
|
-
/** Callback when a plan is selected. Returns the platform pricing model id
|
|
284
|
+
/** Callback when a plan is selected. Returns the platform pricing model id. */
|
|
284
285
|
onClickPlanSelection: PropTypes.func,
|
|
285
286
|
|
|
286
|
-
/** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
|
|
287
|
+
/** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used */
|
|
287
288
|
theme: PropTypes.object
|
|
288
289
|
};
|