@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 879 B
JavaScript
import React from'react';import{PRODUCT_OPTIONS}from'@shopgate/engage/product/constants';import{SurroundPortals}from'@shopgate/engage/components';import{ProductContext}from"../context";import Content from"./components/Content";import Option from"./components/Option";import TextOption from"./components/TextOption";// Export for theme api
export{TextOption,Option as SelectOption};/**
* The Product Options component.
* @returns {JSX}
*/var Options=function Options(){return React.createElement(ProductContext.Consumer,null,function(_ref){var productId=_ref.productId,variantId=_ref.variantId,options=_ref.options;return React.createElement(SurroundPortals,{portalName:PRODUCT_OPTIONS,portalProps:{productId:variantId||productId}},React.createElement(Content/* props needed in connector */,{productId:variantId||productId,currentOptions:options}));});};export default Options;