nestiq-component-library 1.1.170 → 1.1.172
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/components/NewPropertyCard/NewPropertyCard.d.ts +0 -1
- package/dist/components/PropertyImageList/PropertyImageList.d.ts +9 -2
- package/dist/index.es.js +21 -22
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +21 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NewPropertyCard/NewPropertyCard.tsx +0 -8
- package/src/components/PropertyImageList/PropertyImageList.tsx +29 -14
|
@@ -6,9 +6,11 @@ interface PopupProps {
|
|
|
6
6
|
title: string;
|
|
7
7
|
url: string;
|
|
8
8
|
}[];
|
|
9
|
-
|
|
9
|
+
allPictureUrls: {
|
|
10
|
+
title: string;
|
|
11
|
+
url: string;
|
|
12
|
+
}[];
|
|
10
13
|
property: {
|
|
11
|
-
selectedFloorPlan?: string;
|
|
12
14
|
pictures: {
|
|
13
15
|
contentUrl: string;
|
|
14
16
|
pictureType: {
|
|
@@ -16,6 +18,11 @@ interface PopupProps {
|
|
|
16
18
|
};
|
|
17
19
|
}[];
|
|
18
20
|
};
|
|
21
|
+
translations?: {
|
|
22
|
+
allPhotos?: string;
|
|
23
|
+
map?: string;
|
|
24
|
+
grundriss?: string;
|
|
25
|
+
};
|
|
19
26
|
baseUrl: string;
|
|
20
27
|
}
|
|
21
28
|
export default function PropertyImageList(prop: PopupProps): React.JSX.Element;
|
package/dist/index.es.js
CHANGED
|
@@ -262,10 +262,10 @@ function ImageListPopup(props) {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
function PropertyImageList(prop) {
|
|
265
|
-
var _a, _b;
|
|
266
|
-
var
|
|
267
|
-
var
|
|
268
|
-
var
|
|
265
|
+
var _a, _b, _c, _d, _e, _f;
|
|
266
|
+
var _g = useState(0), currentImageIndex = _g[0], setCurrentImageIndex = _g[1];
|
|
267
|
+
var _h = useState(false), isImagePopupOpen = _h[0], setIsImagePopupOpen = _h[1];
|
|
268
|
+
var _j = useState(false), isFloorPlanPopupOpen = _j[0], setIsFloorPlanPopupOpen = _j[1];
|
|
269
269
|
var imageListRef = useRef(null);
|
|
270
270
|
var handleArrowClickInMainImage = function (direction) {
|
|
271
271
|
if (!prop.pictureUrls.length)
|
|
@@ -288,25 +288,28 @@ function PropertyImageList(prop) {
|
|
|
288
288
|
return newIndex || 0;
|
|
289
289
|
});
|
|
290
290
|
};
|
|
291
|
-
var
|
|
291
|
+
var allPhotos = ((_a = prop.property.pictures) === null || _a === void 0 ? void 0 : _a.filter(function (p) { var _a; return ((_a = p.pictureType) === null || _a === void 0 ? void 0 : _a.id) === 2; }).map(function (p, index) { return ({
|
|
292
|
+
url: prop.baseUrl + p.contentUrl,
|
|
293
|
+
title: "Photo ".concat(index + 1),
|
|
294
|
+
}); })) || [];
|
|
295
|
+
var floorPlanImages = ((_b = prop.property.pictures) === null || _b === void 0 ? void 0 : _b.filter(function (p) { var _a; return ((_a = p.pictureType) === null || _a === void 0 ? void 0 : _a.id) === 1; }).map(function (p, index) { return ({
|
|
292
296
|
url: prop.baseUrl + p.contentUrl,
|
|
293
297
|
title: "Floor Plan ".concat(index + 1),
|
|
294
298
|
}); })) || [];
|
|
295
|
-
if (prop.property.selectedFloorPlan) {
|
|
296
|
-
floorPlanImages.push({
|
|
297
|
-
url: prop.property.selectedFloorPlan,
|
|
298
|
-
title: "Selected Floor Plan",
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
299
|
var toggleAllPhotos = function () {
|
|
302
300
|
setIsImagePopupOpen(!isImagePopupOpen);
|
|
303
301
|
};
|
|
304
302
|
var floorPlanClickHandler = function () {
|
|
305
303
|
setIsFloorPlanPopupOpen(true);
|
|
306
304
|
};
|
|
305
|
+
var t = {
|
|
306
|
+
allPhotos: ((_c = prop.translations) === null || _c === void 0 ? void 0 : _c.allPhotos) || "Alle Fotos",
|
|
307
|
+
map: ((_d = prop.translations) === null || _d === void 0 ? void 0 : _d.map) || "Karte",
|
|
308
|
+
grundriss: ((_e = prop.translations) === null || _e === void 0 ? void 0 : _e.grundriss) || "Grundriss",
|
|
309
|
+
};
|
|
307
310
|
return (React.createElement("div", { className: "col-8 Pimagelist " },
|
|
308
311
|
React.createElement("div", { className: "col-12 rounded-5 mainImage d-flex position-relative align-items-center", style: {
|
|
309
|
-
backgroundImage: "url(".concat((
|
|
312
|
+
backgroundImage: "url(".concat((_f = prop.pictureUrls[currentImageIndex]) === null || _f === void 0 ? void 0 : _f.url, ")"),
|
|
310
313
|
backgroundSize: "cover",
|
|
311
314
|
backgroundPosition: "center",
|
|
312
315
|
} },
|
|
@@ -342,11 +345,13 @@ function PropertyImageList(prop) {
|
|
|
342
345
|
React.createElement("div", { className: "col-lg-4 col-4 py-0 px-1", role: "button", onClick: toggleAllPhotos },
|
|
343
346
|
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
344
347
|
React.createElement("img", { src: iconGallery, alt: "Gallery Icon" }),
|
|
345
|
-
React.createElement("span", { className: "listImgText" },
|
|
348
|
+
React.createElement("span", { className: "listImgText" },
|
|
349
|
+
" ",
|
|
350
|
+
t.allPhotos))),
|
|
346
351
|
React.createElement("div", { className: "col-lg-4 col-3 py-0 px-1", role: "button", onClick: floorPlanClickHandler },
|
|
347
352
|
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
348
353
|
React.createElement("img", { src: iconLayers$1, alt: "Layers Icon" }),
|
|
349
|
-
React.createElement("span", { className: "listImgText" },
|
|
354
|
+
React.createElement("span", { className: "listImgText" }, t.grundriss))),
|
|
350
355
|
React.createElement("div", { className: "col-lg-4 col-3 py-0 px-1", role: "button", onClick: function () {
|
|
351
356
|
return window.scrollTo({
|
|
352
357
|
top: document.documentElement.scrollHeight,
|
|
@@ -354,8 +359,8 @@ function PropertyImageList(prop) {
|
|
|
354
359
|
} },
|
|
355
360
|
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
356
361
|
React.createElement("img", { src: iconMap, alt: "Map Icon" }),
|
|
357
|
-
React.createElement("span", { className: "listImgText" },
|
|
358
|
-
isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls:
|
|
362
|
+
React.createElement("span", { className: "listImgText" }, t.map)))))),
|
|
363
|
+
isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: allPhotos, onClose: function () { return setIsImagePopupOpen(false); } })),
|
|
359
364
|
isFloorPlanPopupOpen && (React.createElement(ImageListPopup, { pictureUrls: floorPlanImages, onClose: function () { return setIsFloorPlanPopupOpen(false); } }))));
|
|
360
365
|
}
|
|
361
366
|
|
|
@@ -502,12 +507,6 @@ function PropertyCard(props) {
|
|
|
502
507
|
url: props.baseUrl + p.contentUrl,
|
|
503
508
|
title: "Floor Plan ".concat(index + 1),
|
|
504
509
|
}); })) || [];
|
|
505
|
-
if (props.property.selectedFloorPlan) {
|
|
506
|
-
floorPlanImages.push({
|
|
507
|
-
url: props.property.selectedFloorPlan,
|
|
508
|
-
title: "Selected Floor Plan",
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
510
|
var handleFloorPlanButton = function () {
|
|
512
511
|
setIsImagePopupOpen(true);
|
|
513
512
|
if (props.onFloorPlanClick) {
|