@hanzo/commerce 7.1.24 → 7.1.26

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,
@@ -12,7 +12,7 @@ import CartLineItem from './cart-line-item'
12
12
  import TotalArea from './total-area'
13
13
 
14
14
  import type { LineItem } from '../../../types'
15
- import { reaction } from 'mobx'
15
+ import { autorun, reaction } from 'mobx'
16
16
 
17
17
  const CartPanel: React.FC<PropsWithChildren & {
18
18
  /** fix size and scroll after 'scrollAfter items in teh cart. */
@@ -57,6 +57,10 @@ 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
+ })
60
64
  // return mobx disposer
61
65
  return reaction(() => (
62
66
  cmmc.cartItems.length
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/commerce",
3
- "version": "7.1.24",
3
+ "version": "7.1.26",
4
4
  "description": "e-commerce framework.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",