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.
@@ -21,7 +21,6 @@ interface PopupProps {
21
21
  expose: {
22
22
  title: string;
23
23
  };
24
- selectedFloorPlan?: string;
25
24
  pictures: {
26
25
  contentUrl: string;
27
26
  pictureType: {
@@ -6,9 +6,11 @@ interface PopupProps {
6
6
  title: string;
7
7
  url: string;
8
8
  }[];
9
- floorPlanUrl: string;
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 _c = useState(0), currentImageIndex = _c[0], setCurrentImageIndex = _c[1];
267
- var _d = useState(false), isImagePopupOpen = _d[0], setIsImagePopupOpen = _d[1];
268
- var _e = useState(false), isFloorPlanPopupOpen = _e[0], setIsFloorPlanPopupOpen = _e[1];
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 floorPlanImages = ((_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) === 1; }).map(function (p, index) { return ({
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((_b = prop.pictureUrls[currentImageIndex]) === null || _b === void 0 ? void 0 : _b.url, ")"),
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" }, "Alle Fotos"))),
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" }, "Grundriss"))),
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" }, "Karte")))))),
358
- isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls, onClose: function () { return setIsImagePopupOpen(false); } })),
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) {