pcm-shared-components 0.0.229 → 0.0.231
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.
|
@@ -11,7 +11,6 @@ import PriceToggleButton from './components/PriceToggleButton';
|
|
|
11
11
|
import Icon from '@mdi/react';
|
|
12
12
|
import { mdiRocket, mdiShimmer, mdiFire, mdiTorch } from '@mdi/js';
|
|
13
13
|
import { Button } from '@mui/material';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
14
|
const platformPricingIcons = [mdiShimmer, mdiFire, mdiTorch];
|
|
16
15
|
/**
|
|
17
16
|
* ## Importing the component in your project
|
|
@@ -30,12 +29,10 @@ export const PlatformPaymentPlans = props => {
|
|
|
30
29
|
platformPricingModels,
|
|
31
30
|
onClickPlanSelection,
|
|
32
31
|
saveYearlyImgPath,
|
|
32
|
+
i18next,
|
|
33
33
|
theme
|
|
34
34
|
} = props;
|
|
35
|
-
const
|
|
36
|
-
t
|
|
37
|
-
} = useTranslation();
|
|
38
|
-
const planTypeDescriptions = [t('platform_plan_feature.plan_type_descriptions.free'), t('platform_plan_feature.plan_type_descriptions.standard'), t('platform_plan_feature.plan_type_descriptions.premium')];
|
|
35
|
+
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')];
|
|
39
36
|
const compTheme = theme ? theme : useTheme();
|
|
40
37
|
const defaultTheme = createTheme(compTheme); //---------------------------------------------------
|
|
41
38
|
// Hooks
|
|
@@ -194,12 +191,12 @@ export const PlatformPaymentPlans = props => {
|
|
|
194
191
|
}, /*#__PURE__*/React.createElement(PriceDescription, {
|
|
195
192
|
color: color,
|
|
196
193
|
price: monthly_fee,
|
|
197
|
-
description: Number(billing_period_id) === 1 ? t('common.app.monthly_abbreviation') : t('common.app.yearly_abbreviation'),
|
|
194
|
+
description: Number(billing_period_id) === 1 ? i18next.t('common.app.monthly_abbreviation') : i18next.t('common.app.yearly_abbreviation'),
|
|
198
195
|
expected_price: expected_monthly_fee
|
|
199
196
|
}), /*#__PURE__*/React.createElement(PriceDescription, {
|
|
200
197
|
color: color,
|
|
201
198
|
price: per_reservation_fee,
|
|
202
|
-
description: t('common.app.per_reservation'),
|
|
199
|
+
description: i18next.t('common.app.per_reservation'),
|
|
203
200
|
expected_price: expected_per_reservation_fee
|
|
204
201
|
})), /*#__PURE__*/React.createElement("div", {
|
|
205
202
|
className: "w-full text-center my-12"
|
|
@@ -212,7 +209,7 @@ export const PlatformPaymentPlans = props => {
|
|
|
212
209
|
onClick: () => {
|
|
213
210
|
onClickPlanSelection(platform_pricing_model_id);
|
|
214
211
|
}
|
|
215
|
-
}, t('common.app.start_today'))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
212
|
+
}, i18next.t('common.app.start_today'))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
216
213
|
className: "flex flex-col my-8 w-full max-w-fill md:max-w-192 text-center md:min-h-128 "
|
|
217
214
|
}, /*#__PURE__*/React.createElement("span", {
|
|
218
215
|
className: "my-auto text-gray-600 text-11 whitespace-pre-line "
|
|
@@ -223,7 +220,7 @@ export const PlatformPaymentPlans = props => {
|
|
|
223
220
|
onClick: () => {
|
|
224
221
|
setShowMoreInfo(!showMoreInfo);
|
|
225
222
|
}
|
|
226
|
-
}, showMoreInfo ? t('common.app.less_information') : t('common.app.more_information')))), showMoreInfo && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("ul", {
|
|
223
|
+
}, showMoreInfo ? i18next.t('common.app.less_information') : i18next.t('common.app.more_information')))), showMoreInfo && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("ul", {
|
|
227
224
|
className: "my-12 space-y-10 list-none hover:list-disc pl-8"
|
|
228
225
|
}, (platformPlanFeatures || []).filter(feature => Number(feature.show_in_pricing_table) === 1).sort((a, b) => a.platform_plan_type_id - b.platform_plan_type_id).map(plan => /*#__PURE__*/React.createElement(PlatformListItem, {
|
|
229
226
|
active: Number(platform_plan_type_id) >= Number(plan.platform_plan_type_id),
|
|
@@ -239,19 +236,19 @@ export const PlatformPaymentPlans = props => {
|
|
|
239
236
|
// <>
|
|
240
237
|
// <div>
|
|
241
238
|
// This is a user:
|
|
242
|
-
// {t('common.app.user')}
|
|
239
|
+
// {i18next.t('common.app.user')}
|
|
243
240
|
// </div>
|
|
244
241
|
// <div>
|
|
245
242
|
// This is a search:
|
|
246
|
-
// {t('common.app.search')}
|
|
243
|
+
// {i18next.t('common.app.search')}
|
|
247
244
|
// </div>
|
|
248
245
|
// <div>
|
|
249
246
|
// This is a yes:
|
|
250
|
-
// {t('common.app.yes')}
|
|
247
|
+
// {i18next.t('common.app.yes')}
|
|
251
248
|
// </div>
|
|
252
249
|
// <div>
|
|
253
250
|
// This is a per reservation:
|
|
254
|
-
// {t('common.app.per_reservation')}
|
|
251
|
+
// {i18next.t('common.app.per_reservation')}
|
|
255
252
|
// </div>
|
|
256
253
|
// </>
|
|
257
254
|
React.createElement(ThemeProvider, {
|
|
@@ -291,6 +288,7 @@ PlatformPaymentPlans.defaultProps = {
|
|
|
291
288
|
platformPlanFeatures: [],
|
|
292
289
|
platformPricingModels: [],
|
|
293
290
|
onClickPlanSelection: () => {},
|
|
291
|
+
i18next: undefined,
|
|
294
292
|
saveYearlyImgPath: undefined,
|
|
295
293
|
theme: undefined
|
|
296
294
|
};
|
|
@@ -307,6 +305,9 @@ PlatformPaymentPlans.propTypes = {
|
|
|
307
305
|
/** Callback when a plan is selected. Returns the platform pricing model id. */
|
|
308
306
|
onClickPlanSelection: PropTypes.func,
|
|
309
307
|
|
|
308
|
+
/** i18next localization to use for the component. Don't use the library localization or else it won't load properly on the consuming application */
|
|
309
|
+
i18next: PropTypes.any,
|
|
310
|
+
|
|
310
311
|
/** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used */
|
|
311
312
|
theme: PropTypes.object
|
|
312
313
|
};
|