@hanzo/commerce 7.1.21 → 7.1.23

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.
@@ -10,6 +10,7 @@ import type { LineItem } from '../../../types'
10
10
  import { formatCurrencyValue } from '../../../util'
11
11
  import AddToCartWidget from '../../add-to-cart-widget'
12
12
  import { useCommerce } from '../../../context'
13
+ import { computed } from 'mobx'
13
14
 
14
15
  const DEF_IMG_SIZE=40
15
16
 
@@ -34,12 +35,14 @@ const CartLineItem: React.FC<{
34
35
  imgSizePx=DEF_IMG_SIZE,
35
36
  showPromoCode=false,
36
37
  itemClicked,
37
- selected=false
38
+ //selected=false
38
39
  }) => {
39
40
 
40
41
  const cmmc = useCommerce()
41
42
  const promoPrice = showPromoCode ? cmmc.itemPromoPrice(item) : undefined
42
43
 
44
+ const selected = computed(() => (item.sku === cmmc.currentItem?.sku))
45
+
43
46
  return (
44
47
  <div
45
48
  className={cn(
@@ -63,6 +63,8 @@ const CartPanel: React.FC<PropsWithChildren & {
63
63
  ),
64
64
  (itemCount) => {
65
65
  if (itemCount > 0) {
66
+ console.log("REACTION, COUNT: ", itemCount)
67
+ console.log("REACTION, CURRENT FIRST SKU: ", cmmc.cartItems[0].sku)
66
68
  cmmc.setCurrentItem(cmmc.cartItems[0].sku)
67
69
  }
68
70
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/commerce",
3
- "version": "7.1.21",
3
+ "version": "7.1.23",
4
4
  "description": "e-commerce framework.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",