UNPKG

@shopgate/engage

Version:
6 lines 1.01 kB
import React,{useMemo}from'react';import{hot}from'react-hot-loader/root';import{FulfillmentProvider}from"../../providers";import{FulfillmentSheetContent}from"../FulfillmentSheet/FulfillmentSheetContent";import CartContextMenuChangeFulfillmentContent from"./CartContextMenuChangeFulfillmentContent";/** * The CartContextMenuChangeFulfillmentContent component renders a context menu which enables * switching the active fulfillment method for a cart item. * @param {Object} props The component props. * @returns {JSX} */var CartContextMenuChangeFulfillment=function CartContextMenuChangeFulfillment(_ref){var cartItem=_ref.cartItem;var contextProps=useMemo(function(){return{productId:cartItem.product.id,meta:{cartItem:cartItem},updatePreferredLocation:true};},[cartItem]);return React.createElement(FulfillmentProvider,contextProps,React.createElement(CartContextMenuChangeFulfillmentContent,null),React.createElement(FulfillmentSheetContent,null));};export default hot(CartContextMenuChangeFulfillment);