@shopgate/engage
Version:
Shopgate's ENGAGE library.
62 lines (61 loc) • 2.55 kB
JavaScript
import * as React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Grid from '@shopgate/pwa-common/components/Grid';
import { SurroundPortals } from '@shopgate/engage/components';
import { CART_PAYMENT_BAR, CART_PAYMENT_BAR_TOTALS } from '@shopgate/pwa-common-commerce/cart/constants/Portals';
import PaymentBarShippingCost from "./PaymentBarShippingCost";
import PaymentBarDiscounts from "./PaymentBarDiscounts";
import PaymentBarTax from "./PaymentBarTax";
import PaymentBarSubTotal from "./PaymentBarSubTotal";
import PaymentBarGrandTotal from "./PaymentBarGrandTotal";
import PaymentBarCheckoutButton from "./PaymentBarCheckoutButton";
import PaymentBarPromotionCoupons from "./PaymentBarPromotionCoupons";
import PaymentBarAppliedPromotions from "./PaymentBarAppliedPromotions";
import { wrapper, container, checkoutButtonContainer, checkoutButton } from "./PaymentBarContent.style";
/**
* The PaymentBarContent component.
* @returns {JSX}
*/
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
function PaymentBarContent({
showSeparator
}) {
return /*#__PURE__*/_jsx("div", {
className: classNames(wrapper, 'theme__cart__payment-bar'),
children: /*#__PURE__*/_jsxs(SurroundPortals, {
portalName: CART_PAYMENT_BAR,
children: [/*#__PURE__*/_jsx(Grid, {
className: container,
children: /*#__PURE__*/_jsxs(SurroundPortals, {
portalName: CART_PAYMENT_BAR_TOTALS,
children: [/*#__PURE__*/_jsx(PaymentBarSubTotal, {
showSeparator: showSeparator
}), /*#__PURE__*/_jsx(PaymentBarAppliedPromotions, {
showSeparator: showSeparator
}), /*#__PURE__*/_jsx(PaymentBarPromotionCoupons, {
showSeparator: showSeparator
}), /*#__PURE__*/_jsx(PaymentBarDiscounts, {
showSeparator: showSeparator
}), /*#__PURE__*/_jsx(PaymentBarShippingCost, {
showSeparator: showSeparator
}), /*#__PURE__*/_jsx(PaymentBarTax, {
showSeparator: showSeparator
}), /*#__PURE__*/_jsx(PaymentBarGrandTotal, {
showSeparator: showSeparator
})]
})
}), /*#__PURE__*/_jsx("div", {
className: checkoutButtonContainer,
children: /*#__PURE__*/_jsx("div", {
className: checkoutButton,
children: /*#__PURE__*/_jsx(PaymentBarCheckoutButton, {})
})
})]
})
});
}
PaymentBarContent.defaultProps = {
showSeparator: true
};
export default PaymentBarContent;