@thecb/components 11.1.0-beta.6 → 11.1.0-beta.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.1.0-beta.6",
3
+ "version": "11.1.0-beta.8",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -332,6 +332,7 @@ export const ActiveObligation = {
332
332
  createPaymentFromProfile: fn(),
333
333
  configureMultiCart: fn(),
334
334
  addToMultiCart: fn(),
335
+ openCartSlider: fn(),
335
336
  setDetailedObligation: fn(),
336
337
  navigateToDetailedObligation: fn(),
337
338
  deleteObligationAssoc: fn()
@@ -400,6 +401,7 @@ export const InactiveObligation = {
400
401
  createPaymentFromProfile: fn(),
401
402
  configureMultiCart: fn(),
402
403
  addToMultiCart: fn(),
404
+ openCartSlider: fn(),
403
405
  setDetailedObligation: fn(),
404
406
  navigateToDetailedObligation: fn(),
405
407
  deleteObligationAssoc: fn()
@@ -472,6 +474,7 @@ export const CustomerManagementObligation = {
472
474
  createPaymentFromProfile: fn(),
473
475
  configureMultiCart: fn(),
474
476
  addToMultiCart: fn(),
477
+ openCartSlider: fn(),
475
478
  setDetailedObligation: fn(),
476
479
  navigateToDetailedObligation: fn(),
477
480
  deleteObligationAssoc: fn()
@@ -540,6 +543,7 @@ export const CartEnabledObligation = {
540
543
  createPaymentFromProfile: fn(),
541
544
  configureMultiCart: fn(),
542
545
  addToMultiCart: fn(),
546
+ openCartSlider: fn(),
543
547
  setDetailedObligation: fn(),
544
548
  navigateToDetailedObligation: fn(),
545
549
  deleteObligationAssoc: fn()
@@ -39,22 +39,25 @@ const PaymentDetailsActions = ({
39
39
  configureMultiCart,
40
40
  addToMultiCart,
41
41
  setDetailedObligation,
42
- navigateToDetailedObligation
42
+ navigateToDetailedObligation,
43
+ openCartSlider
43
44
  } = actions;
44
45
  const detailsSlug =
45
46
  config.type === "ACCOUNT"
46
47
  ? `/profile/accounts/details/${obligationSlug}`
47
48
  : `/profile/properties/details/${obligationSlug}`;
48
49
  const handleClick = obligations => {
49
- if (cartEnabled && cartConfig && !isInCart) {
50
- configureMultiCart({
51
- cartId: cartConfig.subClientSlug,
52
- config: cartConfig
53
- });
50
+ if (isInCart) {
51
+ openCartSlider();
52
+ return;
53
+ }
54
+ if (cartEnabled && cartConfig) {
55
+ const { subClientSlug, addToCartConfig } = cartConfig;
56
+ configureMultiCart({ cartId: subClientSlug, config: cartConfig });
54
57
  addToMultiCart({
55
- cartId: cartConfig.subClientSlug,
56
- items: cartConfig.addToCartConfig.items,
57
- itemType: cartConfig.addToCartConfig.itemType
58
+ cartId: subClientSlug,
59
+ items: addToCartConfig.items,
60
+ itemType: addToCartConfig.itemType
58
61
  });
59
62
  } else {
60
63
  setIsLoading(true);
@@ -178,7 +181,7 @@ const PaymentDetailsActions = ({
178
181
  text={text}
179
182
  variant={variant}
180
183
  dataQa={text}
181
- disabled={disableActions || isInCart}
184
+ disabled={disableActions}
182
185
  />
183
186
  </Box>
184
187
  )}
@@ -192,7 +195,7 @@ const PaymentDetailsActions = ({
192
195
  variant={variant}
193
196
  dataQa={text}
194
197
  extraStyles={isMobile && `flex-grow: 1; width: 100%; margin: 0;`}
195
- disabled={disableActions || isInCart}
198
+ disabled={disableActions}
196
199
  />
197
200
  </Box>
198
201
  )}