pcm-shared-components 0.0.230 → 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, withTranslation } from 'react-i18next';
15
14
  const platformPricingIcons = [mdiShimmer, mdiFire, mdiTorch];
16
15
  /**
17
16
  * ## Importing the component in your project
@@ -30,11 +29,10 @@ export const PlatformPaymentPlans = props => {
30
29
  platformPricingModels,
31
30
  onClickPlanSelection,
32
31
  saveYearlyImgPath,
33
- theme,
34
- t
35
- } = props; // const { t} = useTranslation();
36
-
37
- 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')];
32
+ i18next,
33
+ theme
34
+ } = props;
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')];
38
36
  const compTheme = theme ? theme : useTheme();
39
37
  const defaultTheme = createTheme(compTheme); //---------------------------------------------------
40
38
  // Hooks
@@ -193,12 +191,12 @@ export const PlatformPaymentPlans = props => {
193
191
  }, /*#__PURE__*/React.createElement(PriceDescription, {
194
192
  color: color,
195
193
  price: monthly_fee,
196
- 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'),
197
195
  expected_price: expected_monthly_fee
198
196
  }), /*#__PURE__*/React.createElement(PriceDescription, {
199
197
  color: color,
200
198
  price: per_reservation_fee,
201
- description: t('common.app.per_reservation'),
199
+ description: i18next.t('common.app.per_reservation'),
202
200
  expected_price: expected_per_reservation_fee
203
201
  })), /*#__PURE__*/React.createElement("div", {
204
202
  className: "w-full text-center my-12"
@@ -211,7 +209,7 @@ export const PlatformPaymentPlans = props => {
211
209
  onClick: () => {
212
210
  onClickPlanSelection(platform_pricing_model_id);
213
211
  }
214
- }, 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", {
215
213
  className: "flex flex-col my-8 w-full max-w-fill md:max-w-192 text-center md:min-h-128 "
216
214
  }, /*#__PURE__*/React.createElement("span", {
217
215
  className: "my-auto text-gray-600 text-11 whitespace-pre-line "
@@ -222,7 +220,7 @@ export const PlatformPaymentPlans = props => {
222
220
  onClick: () => {
223
221
  setShowMoreInfo(!showMoreInfo);
224
222
  }
225
- }, 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", {
226
224
  className: "my-12 space-y-10 list-none hover:list-disc pl-8"
227
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, {
228
226
  active: Number(platform_plan_type_id) >= Number(plan.platform_plan_type_id),
@@ -238,19 +236,19 @@ export const PlatformPaymentPlans = props => {
238
236
  // <>
239
237
  // <div>
240
238
  // This is a user:
241
- // {t('common.app.user')}
239
+ // {i18next.t('common.app.user')}
242
240
  // </div>
243
241
  // <div>
244
242
  // This is a search:
245
- // {t('common.app.search')}
243
+ // {i18next.t('common.app.search')}
246
244
  // </div>
247
245
  // <div>
248
246
  // This is a yes:
249
- // {t('common.app.yes')}
247
+ // {i18next.t('common.app.yes')}
250
248
  // </div>
251
249
  // <div>
252
250
  // This is a per reservation:
253
- // {t('common.app.per_reservation')}
251
+ // {i18next.t('common.app.per_reservation')}
254
252
  // </div>
255
253
  // </>
256
254
  React.createElement(ThemeProvider, {
@@ -285,11 +283,12 @@ export const PlatformPaymentPlans = props => {
285
283
  }, model))))))
286
284
  );
287
285
  };
288
- export default withTranslation()(PlatformPaymentPlans);
286
+ export default PlatformPaymentPlans;
289
287
  PlatformPaymentPlans.defaultProps = {
290
288
  platformPlanFeatures: [],
291
289
  platformPricingModels: [],
292
290
  onClickPlanSelection: () => {},
291
+ i18next: undefined,
293
292
  saveYearlyImgPath: undefined,
294
293
  theme: undefined
295
294
  };
@@ -306,6 +305,9 @@ PlatformPaymentPlans.propTypes = {
306
305
  /** Callback when a plan is selected. Returns the platform pricing model id. */
307
306
  onClickPlanSelection: PropTypes.func,
308
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
+
309
311
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used */
310
312
  theme: PropTypes.object
311
313
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.230",
3
+ "version": "0.0.231",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {