thm-p3-configurator 0.0.156 → 0.0.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/shared/__components__/ProductCard/ProductCardImage.js +3 -2
- package/dist/src/shared/__components__/ProductCard/index.js +4 -2
- package/dist/src/shared/__containers__/BoardComputerCard.js +4 -2
- package/dist/src/shared/__containers__/ProductsOverview.js +9 -5
- package/package.json +1 -1
|
@@ -13,14 +13,15 @@ function _interopRequireDefault(e) {
|
|
|
13
13
|
}
|
|
14
14
|
const ProductCardImage = _ref => {
|
|
15
15
|
let {
|
|
16
|
-
image
|
|
16
|
+
image,
|
|
17
|
+
isBoardComputer
|
|
17
18
|
} = _ref;
|
|
18
19
|
if (!image) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
21
22
|
return /*#__PURE__*/_react.default.createElement("img", {
|
|
22
23
|
src: image,
|
|
23
|
-
className: (0, _helpers__.withStyle)(
|
|
24
|
+
className: (0, _helpers__.withStyle)("card__image img-fluid ".concat(isBoardComputer ? 'mb-2' : '')),
|
|
24
25
|
alt: "product afbeelding"
|
|
25
26
|
});
|
|
26
27
|
};
|
|
@@ -74,7 +74,8 @@ const ProductCard = _ref => {
|
|
|
74
74
|
onSelect = () => {},
|
|
75
75
|
isOnlyProductInCategory = false,
|
|
76
76
|
isAnotherProductSelected = true,
|
|
77
|
-
isTmg = false
|
|
77
|
+
isTmg = false,
|
|
78
|
+
isBoardComputer = false
|
|
78
79
|
} = _ref;
|
|
79
80
|
const [isSelected, setIsSelected] = (0, _react.useState)(defaultSelected);
|
|
80
81
|
const {
|
|
@@ -114,7 +115,8 @@ const ProductCard = _ref => {
|
|
|
114
115
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
115
116
|
className: (0, _helpers__.withStyle)('col-md-4 d-flex justify-content-center position-relative')
|
|
116
117
|
}, /*#__PURE__*/_react.default.createElement(_ProductCardImage.default, {
|
|
117
|
-
image: productImage
|
|
118
|
+
image: productImage,
|
|
119
|
+
isBoardComputer: isBoardComputer
|
|
118
120
|
}), /*#__PURE__*/_react.default.createElement(_ProductCardDiscountAlert.default, {
|
|
119
121
|
label: productDiscountedLabel,
|
|
120
122
|
price: productPrice,
|
|
@@ -51,6 +51,7 @@ const BoardComputerCard = _ref => {
|
|
|
51
51
|
description,
|
|
52
52
|
title,
|
|
53
53
|
price,
|
|
54
|
+
productImage,
|
|
54
55
|
onSelect = _ref2 => {
|
|
55
56
|
let {
|
|
56
57
|
isSelected,
|
|
@@ -102,7 +103,7 @@ const BoardComputerCard = _ref => {
|
|
|
102
103
|
productTitle: title,
|
|
103
104
|
productDescription: description,
|
|
104
105
|
productUsps: [],
|
|
105
|
-
productImage:
|
|
106
|
+
productImage: productImage,
|
|
106
107
|
isDisabled: false,
|
|
107
108
|
defaultSelected: isSelected,
|
|
108
109
|
onSelect: handleSelect,
|
|
@@ -111,7 +112,8 @@ const BoardComputerCard = _ref => {
|
|
|
111
112
|
productSpecifications: [],
|
|
112
113
|
showPrice: APP_CONFIG.internal,
|
|
113
114
|
canUnselect: canUnselect,
|
|
114
|
-
isOnlyProductInCategory: isSelected
|
|
115
|
+
isOnlyProductInCategory: isSelected,
|
|
116
|
+
isBoardComputer: true
|
|
115
117
|
}), anchorEl && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
116
118
|
isOpen: isModalOpen,
|
|
117
119
|
size: "large",
|
|
@@ -276,11 +276,16 @@ const ProductsOverview = () => {
|
|
|
276
276
|
product: a,
|
|
277
277
|
category: productCategory
|
|
278
278
|
}) ? -1 : 0).map(product => {
|
|
279
|
-
var _product$
|
|
279
|
+
var _product$images, _product$images2, _product$locationPric;
|
|
280
280
|
const isRecommended = (0, _product.checkIfTowbarIsRecommended)({
|
|
281
281
|
product,
|
|
282
282
|
category: productCategory
|
|
283
283
|
});
|
|
284
|
+
|
|
285
|
+
// Generate the product image URL
|
|
286
|
+
const productImageUrl = product !== null && product !== void 0 && (_product$images = product.images) !== null && _product$images !== void 0 && _product$images[0] ? (0, _image.getImageFromHyper)({
|
|
287
|
+
imageId: product === null || product === void 0 || (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2[0]
|
|
288
|
+
}) : _logoPrimary.default;
|
|
284
289
|
if (productCategory === _constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER && selectedCableset) {
|
|
285
290
|
return /*#__PURE__*/_react.default.createElement(_BoardComputerCard.default, {
|
|
286
291
|
defaultSelected: selectedBoardComputer === product.articleNumber,
|
|
@@ -299,7 +304,8 @@ const ProductsOverview = () => {
|
|
|
299
304
|
id: product.articleNumber,
|
|
300
305
|
description: (0, _product.formatHyperDescription)(product === null || product === void 0 ? void 0 : product.description),
|
|
301
306
|
title: product === null || product === void 0 ? void 0 : product.subgroupName,
|
|
302
|
-
price: product === null || product === void 0 ? void 0 : product.price
|
|
307
|
+
price: product === null || product === void 0 ? void 0 : product.price,
|
|
308
|
+
productImage: productImageUrl
|
|
303
309
|
});
|
|
304
310
|
}
|
|
305
311
|
return /*#__PURE__*/_react.default.createElement(_ProductCard.default, {
|
|
@@ -321,9 +327,7 @@ const ProductsOverview = () => {
|
|
|
321
327
|
type: 'remark',
|
|
322
328
|
text: product === null || product === void 0 ? void 0 : product.remark
|
|
323
329
|
}],
|
|
324
|
-
productImage:
|
|
325
|
-
imageId: product === null || product === void 0 || (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2[0]
|
|
326
|
-
}) : _logoPrimary.default,
|
|
330
|
+
productImage: productImageUrl,
|
|
327
331
|
isDisabled: false,
|
|
328
332
|
defaultSelected: productCategory === _constants__.PRODUCT_CATEGORIES.TOWBAR && selectedTowbar === product.articleNumber || productCategory === _constants__.PRODUCT_CATEGORIES.CABLESET && selectedCableset === product.articleNumber || productCategory === _constants__.PRODUCT_CATEGORIES.COMBISET && selectedCombiset === product.articleNumber
|
|
329
333
|
// Set both to false to prevent auto-selection when navigating back
|