@hanzo/commerce 7.1.25 → 7.1.27

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.
@@ -66,8 +66,9 @@ const AddToCartWidget: React.FC<{
66
66
  )
67
67
  }
68
68
 
69
- const inc = () => {
69
+ const inc = (event: React.MouseEvent<HTMLElement>) => {
70
70
  item.increment()
71
+ event.stopPropagation()
71
72
  sendGAEvent('add_to_cart', {
72
73
  items: [{
73
74
  item_id: item.sku,
@@ -91,8 +92,9 @@ const AddToCartWidget: React.FC<{
91
92
  })
92
93
  }
93
94
 
94
- const dec = () => {
95
+ const dec = (event: React.MouseEvent<HTMLElement>) => {
95
96
  item.decrement()
97
+ event.stopPropagation()
96
98
  sendGAEvent('remove_from_cart', {
97
99
  items: [{
98
100
  item_id: item.sku,
@@ -35,13 +35,13 @@ const CartLineItem: React.FC<{
35
35
  imgSizePx=DEF_IMG_SIZE,
36
36
  showPromoCode=false,
37
37
  itemClicked,
38
- //selected=false
38
+ selected=false
39
39
  }) => {
40
40
 
41
41
  const cmmc = useCommerce()
42
42
  const promoPrice = showPromoCode ? cmmc.itemPromoPrice(item) : undefined
43
43
 
44
- const selected = item.sku === cmmc.currentItem?.sku
44
+ //const selected = item.sku === cmmc.currentItem?.sku
45
45
 
46
46
  return (
47
47
  <div
@@ -57,18 +57,12 @@ const CartPanel: React.FC<PropsWithChildren & {
57
57
  if (!cmmc.cartEmpty && !cmmc.currentItem) {
58
58
  cmmc.setCurrentItem(cmmc.cartItems[0].sku)
59
59
  }
60
-
61
- autorun(() => {
62
- console.log('AUTORUN: ' + cmmc.currentItem?.sku)
63
- })
64
60
  // return mobx disposer
65
61
  return reaction(() => (
66
62
  cmmc.cartItems.length
67
63
  ),
68
64
  (itemCount) => {
69
65
  if (itemCount > 0) {
70
- console.log("REACTION, COUNT: ", itemCount)
71
- console.log("REACTION, CURRENT FIRST SKU: ", cmmc.cartItems[0].sku)
72
66
  cmmc.setCurrentItem(cmmc.cartItems[0].sku)
73
67
  }
74
68
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/commerce",
3
- "version": "7.1.25",
3
+ "version": "7.1.27",
4
4
  "description": "e-commerce framework.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",