pcm-shared-components 0.0.250 → 0.0.251

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.
@@ -26,7 +26,7 @@ export const GenericDialogWindow = props => {
26
26
  // Hooks
27
27
  //---------------------------------------------------
28
28
 
29
- const [can_save, setCanSave] = useState(false);
29
+ const [canSave, setCanSave] = useState(false);
30
30
  const [isLoading, setIsLoading] = useState(false);
31
31
  const [managedAppBarMenu, setManagedAppBarMenu] = useState(undefined);
32
32
  const [save_button_label, setSaveButtonLabel] = useState(undefined);
@@ -126,7 +126,7 @@ export const GenericDialogWindow = props => {
126
126
  return { ...mm,
127
127
  onClick: onSave,
128
128
  name: save_button_label ? save_button_label : mm.name,
129
- hideMenu: !(can_save && showSaveButton)
129
+ hideMenu: !(canSave && showSaveButton)
130
130
  };
131
131
  } else {
132
132
  return mm;
@@ -136,7 +136,7 @@ export const GenericDialogWindow = props => {
136
136
  //Need to re-apply any onClick override to ensure they are still properly set by what was overridden from the child component.
137
137
  // setOverrides();
138
138
  }
139
- }, [appBarMenu, can_save, showSaveButton, save_button_label]);
139
+ }, [appBarMenu, canSave, showSaveButton, save_button_label]);
140
140
 
141
141
  const handleOnClose = (event, reason) => {
142
142
  if (reason !== 'backdropClick' || closeOnBackdropClick) {
@@ -170,6 +170,7 @@ export const GenericDialogWindow = props => {
170
170
  className: "w-full h-full "
171
171
  }, component ? /*#__PURE__*/React.cloneElement(component, {
172
172
  parentProps: {
173
+ canSave,
173
174
  setCanSave,
174
175
  isLoading,
175
176
  setIsLoading,
@@ -188,7 +189,7 @@ export const GenericDialogWindow = props => {
188
189
  variant: "contained",
189
190
  color: "primary",
190
191
  onClick: onSave,
191
- disabled: !can_save
192
+ disabled: !canSave
192
193
  }, save_button_label ? save_button_label : getSaveButtonLabel()))), /*#__PURE__*/React.createElement(LoadingBackdrop, {
193
194
  isLoading: isLoading
194
195
  })));
@@ -28,6 +28,9 @@ const platformPricingIcons = [mdiShimmer, mdiFire, mdiTorch];
28
28
 
29
29
  export const PlatformPaymentPlans = props => {
30
30
  const {
31
+ currentlySelectedPlatformPlanId,
32
+ selectPlatformButtonLabel,
33
+ showSelectPlatformButton,
31
34
  platformPlanFeatures,
32
35
  platformPricingModels,
33
36
  onClickPlanSelection,
@@ -154,9 +157,16 @@ export const PlatformPaymentPlans = props => {
154
157
  className: "my-24"
155
158
  }, /*#__PURE__*/React.createElement(PlatformPlanPrices, _extends({
156
159
  i18next: i18next
157
- }, props)), /*#__PURE__*/React.createElement("div", {
160
+ }, props)), showSelectPlatformButton && /*#__PURE__*/React.createElement("div", {
158
161
  className: "w-full text-center mt-24"
159
- }, /*#__PURE__*/React.createElement(Button, {
162
+ }, Number(currentlySelectedPlatformPlanId) === Number(id) ? /*#__PURE__*/React.createElement(Button, {
163
+ className: "max-w-min whitespace-nowrap m-auto font-900",
164
+ variant: "contained",
165
+ disabled: true,
166
+ style: {
167
+ color: color
168
+ }
169
+ }, i18next.t('common.app.current')) : /*#__PURE__*/React.createElement(Button, {
160
170
  className: "max-w-min whitespace-nowrap m-auto font-900",
161
171
  variant: "outlined",
162
172
  style: {
@@ -165,7 +175,7 @@ export const PlatformPaymentPlans = props => {
165
175
  onClick: () => {
166
176
  handlePlanSelection(id);
167
177
  }
168
- }, i18next.t('common.app.start_today')))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
178
+ }, selectPlatformButtonLabel ? selectPlatformButtonLabel : i18next.t('common.app.start_today')))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
169
179
  className: "flex flex-col mx-auto w-full max-w-fill text-center min-h-256 "
170
180
  }, /*#__PURE__*/React.createElement("span", {
171
181
  className: "my-auto p-12 text-gray-600 text-17 whitespace-pre-line "
@@ -221,6 +231,9 @@ export const PlatformPaymentPlans = props => {
221
231
  };
222
232
  export default PlatformPaymentPlans;
223
233
  PlatformPaymentPlans.defaultProps = {
234
+ currentlySelectedPlatformPlanId: -1,
235
+ selectPlatformButtonLabel: undefined,
236
+ showSelectPlatformButton: true,
224
237
  platformPlanFeatures: [],
225
238
  platformPricingModels: [],
226
239
  onClickPlanSelection: () => {},
@@ -229,6 +242,15 @@ PlatformPaymentPlans.defaultProps = {
229
242
  theme: undefined
230
243
  };
231
244
  PlatformPaymentPlans.propTypes = {
245
+ /** This is the current plan that is being used by the campground. The platform button won't be enable and the text on the button will say Current so the user knows on which plan they currently are on. */
246
+ currentlySelectedPlatformPlanId: PropTypes.any,
247
+
248
+ /** This is the label that appears on the select platform button */
249
+ selectPlatformButtonLabel: PropTypes.string,
250
+
251
+ /** Toggles the view for the buttons on the platform cards */
252
+ showSelectPlatformButton: PropTypes.bool,
253
+
232
254
  /** Displays the save up to image above the yearly toggle */
233
255
  saveYearlyImgPath: PropTypes.string,
234
256
 
@@ -307,6 +307,7 @@
307
307
  "copy": "Copy",
308
308
  "creation_date": "Creation Date",
309
309
  "critical": "Critical",
310
+ "current": "Current",
310
311
  "daily": "Daily",
311
312
  "daily_price": "Daily Price",
312
313
  "date": "Date",
@@ -307,6 +307,7 @@
307
307
  "copy": "Dupdo",
308
308
  "creation_date": "Fecha de creación",
309
309
  "critical": "Crítico",
310
+ "current": "Actual",
310
311
  "daily": "A diario",
311
312
  "daily_price": "Precio diario",
312
313
  "date": "Fecha",
@@ -307,6 +307,7 @@
307
307
  "copy": "Copier",
308
308
  "creation_date": "Date de création",
309
309
  "critical": "Critique",
310
+ "current": "Courant",
310
311
  "daily": "Quotidien",
311
312
  "daily_price": "Prix ​​quotidien",
312
313
  "date": "Date",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.250",
3
+ "version": "0.0.251",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {