Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

const tslib_1 = require("tslib");

const react_1 = tslib_1.__importDefault(require("react"));

const renderProps_1 = require("./renderProps");

class ProductPrice extends react_1.default.PureComponent {
  render() {
    const {
      salePrice,
      renderRegularPrice,
      renderSalePrice,
      renderWrapper
    } = this.props;
    const isSalePrice = !!salePrice;
    const children = react_1.default.createElement(react_1.default.Fragment, null, salePrice && renderSalePrice(this.props), renderRegularPrice(Object.assign({
      isSalePrice
    }, this.props)));
    const view = renderWrapper(Object.assign({}, this.props, {
      children
    }));
    return view;
  }

}

ProductPrice.defaultProps = {
  className: '',
  regularPrice: '$0.00',
  renderWrapper: renderProps_1.defaultRenderWrapper,
  renderSalePrice: renderProps_1.defaultRenderSalePrice,
  renderRegularPrice: renderProps_1.defaultRenderRegularPrice
};
exports.ProductPrice = ProductPrice;
exports.default = ProductPrice; //# sourceMappingURL=ProductPrice.js.map