Repository URL to install this package:
|
Version:
3.0.1 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const exotic_1 = require("exotic");
const Empty_1 = require("../../../atoms/Empty");
const state_1 = require("../../../../state");
const ToggleList_1 = require("../../../molecules/ToggleList");
const styled_1 = require("./styled");
const renderProps_1 = require("./renderProps");
class ShippingMethodOption extends react_1.default.PureComponent {
render() {
const {
list
} = this.props;
const shippingMethodOptionList = exotic_1.isArray(list) && list.map(state_1.toCommonState);
const view = shippingMethodOptionList.length > 0 ? react_1.default.createElement(styled_1.ToggleList, Object.assign({}, this.props, {
list: shippingMethodOptionList
})) : react_1.default.createElement(Empty_1.Empty, null);
return view;
}
}
ShippingMethodOption.defaultProps = {
className: '',
title: 'Shipping method',
//
renderHeader: ToggleList_1.defaultRenderHeader,
renderIcon: ToggleList_1.defaultRenderIcon,
renderText: renderProps_1.defaultRenderText,
selectedDataQa: 'qa-shipping-methods',
unselectedDataQa: 'qa-shipping-methods'
};
exports.ShippingMethodOption = ShippingMethodOption;
exports.default = ShippingMethodOption; //# sourceMappingURL=ShippingMethodOption.js.map