@shopgate/engage
Version:
Shopgate's ENGAGE library.
7 lines • 853 B
JavaScript
import*as React from'react';import noop from'lodash/noop';import{I18n,ContextMenu}from'@shopgate/engage/components';import{DIRECT_SHIP}from"../../constants";/**
* @param {Object} props The component props.
* @property {Object} props.cartItem cartItem
* @property {Function} props.onClick onClick
* @property {Function} props.closeMenu closeMenu
* @returns {JSX}
*/export var CartContextMenuItemChangeLocation=function CartContextMenuItemChangeLocation(props){var cartItem=props.cartItem,onClick=props.onClick,closeMenu=props.closeMenu;if(!cartItem.fulfillment||cartItem.fulfillment.method===DIRECT_SHIP){return null;}return React.createElement(ContextMenu.Item,{onClick:onClick,closeMenu:closeMenu},React.createElement(I18n.Text,{string:"locations.change_location"}));};CartContextMenuItemChangeLocation.defaultProps={onClick:noop,closeMenu:noop};