Repository URL to install this package:
|
Version:
2.1.16 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const utils_1 = require("@skava/utils");
const exotic_1 = require("exotic");
const styled_1 = require("./styled");
function defaultRenderProductItem(props) {
const {
productItem
} = props;
const item = Object.assign({}, productItem, {
brandNameDataQa: 'qa-product-name',
productNameDataQa: 'qa-product-description'
});
return react_1.default.createElement(styled_1.StyledProductItem, {
item: item
});
}
exports.defaultRenderProductItem = defaultRenderProductItem;
function defaultRenderShippingAddress(props) {
return react_1.default.createElement(styled_1.StyledShippingAddress, Object.assign({}, props));
}
exports.defaultRenderShippingAddress = defaultRenderShippingAddress;
function defaultRenderShippingMethod(props) {
const {
identifier,
shippingMethodOptionList,
handleShippingMethodChange
} = props;
const handleChange = (event, item) => {
if (exotic_1.isFunction(handleShippingMethodChange)) {
handleShippingMethodChange({
item,
identifier
});
}
};
return react_1.default.createElement(styled_1.StyledShippingMethod, {
list: shippingMethodOptionList,
onChange: handleChange
});
}
exports.defaultRenderShippingMethod = defaultRenderShippingMethod;
function defaultRenderDeliveryInstruction(props) {
const {
deliveryInstructionConfig
} = props,
remainingProps = tslib_1.__rest(props, ["deliveryInstructionConfig"]);
const passThroughProps = utils_1.omit(props, ['renderExpandedView']);
return react_1.default.createElement(styled_1.StyledDeliveryInstruction, Object.assign({}, deliveryInstructionConfig, passThroughProps));
}
exports.defaultRenderDeliveryInstruction = defaultRenderDeliveryInstruction;