@pelcro/react-pelcro-js 4.0.0-alpha.87 → 4.0.0-alpha.88

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.
package/dist/index.cjs.js CHANGED
@@ -30658,7 +30658,8 @@ const AddressCreateModal = ({
30658
30658
  resetView,
30659
30659
  giftRecipient,
30660
30660
  product,
30661
- plan
30661
+ plan,
30662
+ order
30662
30663
  } = usePelcro();
30663
30664
  const {
30664
30665
  t
@@ -30686,7 +30687,7 @@ const AddressCreateModal = ({
30686
30687
  resetView();
30687
30688
  };
30688
30689
 
30689
- const showBackButton = Boolean(product && plan && !giftRecipient);
30690
+ const showBackButton = Boolean(product && plan && !giftRecipient || order);
30690
30691
 
30691
30692
  const userHasAddress = () => {
30692
30693
  var _window$Pelcro$user$r, _window$Pelcro$user$r2;
@@ -30702,9 +30703,17 @@ const AddressCreateModal = ({
30702
30703
  return switchView("address-select");
30703
30704
  }
30704
30705
 
30706
+ if (order && isUserHasAddress) {
30707
+ return switchView("address-select");
30708
+ }
30709
+
30705
30710
  if (product && plan) {
30706
30711
  return switchView("plan-select");
30707
30712
  }
30713
+
30714
+ if (order) {
30715
+ return switchView("cart");
30716
+ }
30708
30717
  };
30709
30718
 
30710
30719
  return /*#__PURE__*/React__default['default'].createElement(Modal, {
package/dist/index.esm.js CHANGED
@@ -30628,7 +30628,8 @@ const AddressCreateModal = ({
30628
30628
  resetView,
30629
30629
  giftRecipient,
30630
30630
  product,
30631
- plan
30631
+ plan,
30632
+ order
30632
30633
  } = usePelcro();
30633
30634
  const {
30634
30635
  t
@@ -30656,7 +30657,7 @@ const AddressCreateModal = ({
30656
30657
  resetView();
30657
30658
  };
30658
30659
 
30659
- const showBackButton = Boolean(product && plan && !giftRecipient);
30660
+ const showBackButton = Boolean(product && plan && !giftRecipient || order);
30660
30661
 
30661
30662
  const userHasAddress = () => {
30662
30663
  var _window$Pelcro$user$r, _window$Pelcro$user$r2;
@@ -30672,9 +30673,17 @@ const AddressCreateModal = ({
30672
30673
  return switchView("address-select");
30673
30674
  }
30674
30675
 
30676
+ if (order && isUserHasAddress) {
30677
+ return switchView("address-select");
30678
+ }
30679
+
30675
30680
  if (product && plan) {
30676
30681
  return switchView("plan-select");
30677
30682
  }
30683
+
30684
+ if (order) {
30685
+ return switchView("cart");
30686
+ }
30678
30687
  };
30679
30688
 
30680
30689
  return /*#__PURE__*/React__default.createElement(Modal, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.87",
4
+ "version": "4.0.0-alpha.88",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",