69ea94378b
* first cut - removing an item from cart: - add actions to cart store for removing an item and keeping track of pending removal API call - add reducer logic for storing pending state on an item, and removing an item - expose removeCartItem on new useStoreCartItems hook - hook it up to remove link / trashcan icon in row item * disable cart quantity picker/remove link while API request in progress: - expose cart item pending status from store using selector - use selector to disable quantity related components in line item row * fix jsdoc - getCartItem returns undefined if not found * add typedef for cart items store object provided by hook * fix rebase error - key prop went awol * orient useStoreCartItem hook to single cart item: - simplify interface for client component - isPending bool (was callback) - removeItem callback no need to specify item key + reinstate disabled prop on remove link when updating (lost in rebase) * move cart item pending state out of cartItems, preserve API state shape: - pending is now stored as array of keys - fix isItemQuantityPending selector (now much simpler) * ensure react knows that our useSelect depends on cartItemKey |
||
---|---|---|
.. | ||
empty-cart | ||
full-cart | ||
edit.js | ||
example.js | ||
frontend.js | ||
index.js | ||
style.scss |