nestiq-component-library 1.0.23 → 1.0.25

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.
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import "./PropertyImageList.css";
2
3
  import PopupProps from "../ImageListPopup/ImageListPopup";
3
4
  interface PopupProps {
@@ -9,8 +10,7 @@ interface PopupProps {
9
10
  askingPrice: string;
10
11
  };
11
12
  pictureUrls: any[];
12
- currentImageIndex: number;
13
- isImagePopupOpen: boolean;
13
+ imageListRef: any;
14
14
  }
15
- export default function PropertyImageList(prop: PopupProps): void;
15
+ export default function PropertyImageList(prop: PopupProps): React.JSX.Element;
16
16
  export {};
package/dist/index.es.js CHANGED
@@ -89,17 +89,110 @@ function PropertyDetailsHeader(props) {
89
89
  "Grundst\u00FCck")))));
90
90
  }
91
91
 
92
+ var iconArrowRight = "Icon_rightArrow.svg";
93
+
94
+ var blcIconArrowRight = "blackarrow-Right.svg";
95
+
96
+ var blcIconArrowLeft = "blckarrow-Left.svg";
97
+
98
+ var iconArrowLeft = "chevron-left.svg";
99
+
100
+ var iconGallery = "icon_gallery.svg";
101
+
102
+ var iconMap = "icon_map.svg";
103
+
104
+ var iconLayers = "layer_icon.svg";
105
+
92
106
  var css_248z$2 = ".mainImage {\r\n\theight: 80%;\r\n\t\r\n}\r\n\r\n.secondList {\r\n\theight: 20%;\r\n\t\t\r\n\r\n}\r\n\r\n.listImageButton {\r\n\tbackground-color: black;\r\n\talign-items: center !important;\r\n\tjustify-content: center !important;\r\n}\r\n\r\n.listImgText {\r\n\theight: 30px;\r\n\tfont-size: 14px;\r\n\tline-height: 2.14;\r\n\tcolor: #fff;\r\n}\r\n\r\n.arroIconColour {\r\n\theight: 30px;\r\n\tfill: #fff !important;\r\n}\r\n\r\n.onImageArrow {\r\n\twidth: 50px;\r\n\theight: 50px;\r\n\tpadding: 23px 8px;\r\n\tbackground-color: rgba(255, 255, 255, 0.8);\r\n}\r\n\r\n.blackArrow {\r\n\twidth: 20px;\r\n\theight: 20px;\r\n}\r\n\r\n.imagesArray {\r\n\tbackground-size: 'cover' !important;\r\n}\r\n@media (min-width: 800px) {\r\n .Pimagelist {\r\n max-width: 1800px;\r\n \r\n \r\n }\r\n}\r\n\r\n\r\n\r\n\r\n";
93
107
  styleInject(css_248z$2);
94
108
 
95
109
  var css_248z$1 = ".popup-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.7);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 10000;\r\n}\r\n\r\n.popup-container {\r\n background-color: transparent;\r\n border-radius: 8px;\r\n max-width: 90%;\r\n max-height: 90%;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n position: relative;\r\n}\r\n\r\n.popup-header {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n padding: 1rem;\r\n position: absolute;\r\n top: 0;\r\n}\r\n\r\n.popup-title {\r\n color: white;\r\n font-size: 24px;\r\n font-weight: bold;\r\n}\r\n\r\n.btn-close {\r\n position: absolute;\r\n right: 1rem;\r\n top: 1rem;\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 24px;\r\n cursor: pointer;\r\n}\r\n\r\n.popup-body {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 1rem;\r\n position: relative;\r\n flex: 1;\r\n}\r\n\r\n.main-image {\r\n max-width: 100%;\r\n max-height: 80vh;\r\n border-radius: 8px;\r\n}\r\n\r\n.btn-prev,\r\n.btn-next {\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 48px;\r\n cursor: pointer;\r\n position: absolute;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n}\r\n\r\n.btn-prev {\r\n left: 10px;\r\n}\r\n\r\n.btn-next {\r\n right: 10px;\r\n}\r\n\r\n.popup-thumbnails {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 10px;\r\n padding: 1rem;\r\n}\r\n\r\n.thumbnail {\r\n width: 60px;\r\n height: 60px;\r\n object-fit: cover;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n opacity: 0.6;\r\n}\r\n\r\n.thumbnail.active {\r\n border: 2px solid white;\r\n opacity: 1;\r\n}\r\n";
96
110
  styleInject(css_248z$1);
97
111
 
112
+ function ImageListPopup(props) {
113
+ var _a = useState(true), showPopUp = _a[0], setShowPopUp = _a[1];
114
+ // const { id } = useParams();
115
+ var _b = useState(null); _b[0]; var setMainImage = _b[1];
116
+ var _c = useState(0), currentImageIndex = _c[0], setCurrentImageIndex = _c[1];
117
+ // const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
118
+ useRef(null);
119
+ // const baseUrl = "https://api-dev.nestiq.de";
120
+ // const pictureUrls = props.property.pictures.map(
121
+ // (picture) => `${baseUrl}${picture.contentUrl}`
122
+ // );
123
+ props.pictureUrls.map(function (pic) {
124
+ return {
125
+ src: pic,
126
+ title: "Not Specified",
127
+ };
128
+ });
129
+ useEffect(function () {
130
+ if (props.pictureUrls.length > 0) {
131
+ setMainImage(props.pictureUrls[0]);
132
+ }
133
+ }, [props.pictureUrls]);
134
+ var handleArrowClickInMainImage = function (direction) {
135
+ if (!props.property || props.pictureUrls.length === 0)
136
+ return;
137
+ var newIndex = currentImageIndex;
138
+ if (direction === "left") {
139
+ newIndex =
140
+ (currentImageIndex - 1 + props.pictureUrls.length) %
141
+ props.pictureUrls.length;
142
+ }
143
+ else if (direction === "right") {
144
+ newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
145
+ }
146
+ setCurrentImageIndex(newIndex);
147
+ setMainImage(props.pictureUrls[newIndex]);
148
+ props.imageListRef.current.scrollTo({
149
+ left: newIndex * 150,
150
+ behavior: "smooth",
151
+ });
152
+ };
153
+ var handleClose = function () {
154
+ setShowPopUp(false);
155
+ };
156
+ return (React.createElement("div", null, showPopUp && (React.createElement("div", { className: "popup-overlay" },
157
+ React.createElement("div", { className: " d-flex flex-column col-6 " },
158
+ React.createElement("div", { className: "d-flex align-self-end me-0 ms-5" },
159
+ React.createElement("img", { src: iconClose, alt: "close", className: "closeIcon ", onClick: handleClose })),
160
+ React.createElement("div", { className: "d-flex justify-content-center" },
161
+ React.createElement("div", { className: "p-2 bd-highlight align-self-center align-items-center me-5" },
162
+ React.createElement("div", { className: "rounded-circle border onImageArrow start-0 d-flex ", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
163
+ React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow align-self-center", alt: "Left Arrow" }))),
164
+ React.createElement("div", { className: "p-2 bd-highlight" },
165
+ React.createElement("div", { className: " rounded-5 mainImage ", style: {
166
+ backgroundImage: "url(".concat(props.pictureUrls[currentImageIndex], ")"),
167
+ height: "350px",
168
+ width: "600px",
169
+ backgroundSize: "cover",
170
+ backgroundPosition: "center",
171
+ } })),
172
+ React.createElement("div", { className: "p-2 bd-highlight align-self-center ms-5" },
173
+ " ",
174
+ React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
175
+ React.createElement("img", { src: blcIconArrowRight, className: "blackArrow align-self-center", alt: "Right Arrow" })))),
176
+ React.createElement("div", { className: "d-flex flex-row" }),
177
+ React.createElement("div", { className: "d-flex flex-row gap-4 w-100 secondList " },
178
+ React.createElement("div", { className: "col-lg-12 d-flex flex-row p-1 align-self-center mt-5" },
179
+ React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
180
+ React.createElement("div", { className: "col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto ", ref: props.imageListRef }, props.property && (React.createElement("div", { className: "col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3" }, props.pictureUrls.map(function (imageUrl, index) { return (React.createElement("div", { key: index, className: "col-lg-12 h-100 d-flex", onClick: function () {
181
+ setMainImage(imageUrl);
182
+ setCurrentImageIndex(index);
183
+ props.imageListRef.current.scrollTo({
184
+ left: index * 150,
185
+ behavior: "smooth",
186
+ });
187
+ }, role: "button" },
188
+ React.createElement("img", { src: imageUrl, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); }))))))))))));
189
+ }
190
+
98
191
  function PropertyImageList(prop) {
99
192
  var _a = useState(null); _a[0]; var setMainImage = _a[1];
100
- var _b = useState(0); _b[0]; _b[1];
101
- var _c = useState(false); _c[0]; _c[1];
102
- useRef(null);
193
+ var _b = useState(0), currentImageIndex = _b[0], setCurrentImageIndex = _b[1];
194
+ var _c = useState(false), isImagePopupOpen = _c[0], setIsImagePopupOpen = _c[1];
195
+ var imageListRef = useRef(null);
103
196
  var _d = useState(false); _d[0]; _d[1];
104
197
  // const [pictureUrls, setPictureUrls] = useState([]);
105
198
  // const baseUrl = "https://api-dev.nestiq.de";
@@ -111,6 +204,70 @@ function PropertyImageList(prop) {
111
204
  setMainImage(prop.pictureUrls[0]);
112
205
  }
113
206
  }, [prop.pictureUrls]);
207
+ var handleArrowClickInMainImage = function (direction) {
208
+ if (!prop.property || prop.pictureUrls.length === 0)
209
+ return;
210
+ var newIndex = currentImageIndex;
211
+ if (direction === "left") {
212
+ newIndex =
213
+ (currentImageIndex - 1 + prop.pictureUrls.length) %
214
+ prop.pictureUrls.length;
215
+ }
216
+ else if (direction === "right") {
217
+ newIndex = (currentImageIndex + 1) % prop.pictureUrls.length;
218
+ }
219
+ setCurrentImageIndex(newIndex);
220
+ setMainImage(prop.pictureUrls[newIndex]);
221
+ };
222
+ var toggleAllPhotos = function () {
223
+ setIsImagePopupOpen(!isImagePopupOpen);
224
+ };
225
+ return (React.createElement("div", { className: "col-8 me-2 Pimagelist" },
226
+ React.createElement("div", { className: "col-12 rounded-5 mainImage d-flex position-relative align-items-center", style: {
227
+ backgroundImage: "url(".concat(prop.pictureUrls[currentImageIndex], ")"),
228
+ backgroundSize: "cover",
229
+ backgroundPosition: "center",
230
+ } },
231
+ React.createElement("div", { className: "rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
232
+ React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow", alt: "Left Arrow" })),
233
+ React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
234
+ React.createElement("img", { src: blcIconArrowRight, className: "blackArrow", alt: "Right Arrow" }))),
235
+ React.createElement("div", { className: "d-flex flex-row gap-1 col-12 secondList" },
236
+ React.createElement("div", { className: "col-lg-6 d-flex flex-row p-1" },
237
+ React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
238
+ React.createElement("div", { className: "col-1 h-100 d-flex position-absolute start-0", onClick: function () { return handleArrowClickInMainImage("left"); }, role: "button" },
239
+ React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
240
+ React.createElement("img", { src: iconArrowLeft, className: "arroIconColour", alt: "Left Arrow" }))),
241
+ React.createElement("div", { className: "col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1", ref: imageListRef }, prop.property && (React.createElement("div", { className: "col-lg-5 h-100 d-flex gap-2 flex-row rounded-3" }, prop.pictureUrls.map(function (imageUrl, index) { return (React.createElement("div", { key: index, className: "col-lg-12 h-100 d-flex", onClick: function () {
242
+ setMainImage(imageUrl);
243
+ setCurrentImageIndex(index);
244
+ prop.imageListRef.current.scrollTo({
245
+ left: index * 150,
246
+ behavior: "smooth",
247
+ });
248
+ }, role: "button" },
249
+ React.createElement("img", { src: imageUrl, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); })))),
250
+ React.createElement("div", { className: "col-1 h-100 d-flex position-absolute end-0 top-0", onClick: function () { return handleArrowClickInMainImage("right"); }, role: "button" },
251
+ React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1" },
252
+ React.createElement("img", { src: iconArrowRight, className: "arroIconColour", alt: "Right Arrow" }))))),
253
+ React.createElement("div", { className: "col-6 d-flex flex-row" },
254
+ React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: toggleAllPhotos },
255
+ React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
256
+ React.createElement("img", { src: iconGallery, alt: "Gallery Icon" }),
257
+ React.createElement("span", { className: "listImgText" }, "Alle Fotos"))),
258
+ React.createElement("div", { className: "col-lg-4 p-1", role: "button" },
259
+ React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
260
+ React.createElement("img", { src: iconLayers, alt: "Layers Icon" }),
261
+ React.createElement("span", { className: "listImgText" }, "Grundriss"))),
262
+ React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: function () {
263
+ return window.scrollTo({
264
+ top: document.documentElement.scrollHeight,
265
+ });
266
+ } },
267
+ React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
268
+ React.createElement("img", { src: iconMap, alt: "Map Icon" }),
269
+ React.createElement("span", { className: "listImgText" }, "Karte"))))),
270
+ isImagePopupOpen && (React.createElement(ImageListPopup, { currentImageIndex: currentImageIndex, handleArrowClickInMainImage: handleArrowClickInMainImage, imageListRef: imageListRef, pictureUrls: prop.pictureUrls, property: prop.property }))));
114
271
  }
115
272
 
116
273
  var layerIcon = "LayersIcon.svg";
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/assets/images/icon_close_2.png","../node_modules/style-inject/dist/style-inject.es.js","../src/assets/images/icon_share_1.svg","../src/assets/images/locationIconBlack.svg","../src/assets/Images/LayersIcon.svg","../src/assets/images/locationIcon.svg","../src/assets/Images/default-property.jpg"],"sourcesContent":["export default \"icon_close_2.png\"","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export default \"icon_share_1.svg\"","export default \"locationIconBlack.svg\"","export default \"LayersIcon.svg\"","export default \"locationIcon.svg\"","export default \"default-property.jpg\""],"names":[],"mappings":";;;;;;;AAAA,gBAAe;;ACAf,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;ACzBA,gBAAe;;ACAf,qBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAf,gBAAe;;ACAf,mBAAe;;;;;ACAf,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"index.es.js","sources":["../src/assets/images/icon_close_2.png","../node_modules/style-inject/dist/style-inject.es.js","../src/assets/images/icon_share_1.svg","../src/assets/images/locationIconBlack.svg","../src/assets/Images/Icon_rightArrow.svg","../src/assets/Images/blackarrow-Right.svg","../src/assets/Images/blckarrow-Left.svg","../src/assets/Images/chevron-left.svg","../src/assets/Images/icon_gallery.svg","../src/assets/Images/icon_map.svg","../src/assets/Images/layer_icon.svg","../src/assets/Images/LayersIcon.svg","../src/assets/images/locationIcon.svg","../src/assets/Images/default-property.jpg"],"sourcesContent":["export default \"icon_close_2.png\"","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export default \"icon_share_1.svg\"","export default \"locationIconBlack.svg\"","export default \"Icon_rightArrow.svg\"","export default \"blackarrow-Right.svg\"","export default \"blckarrow-Left.svg\"","export default \"chevron-left.svg\"","export default \"icon_gallery.svg\"","export default \"icon_map.svg\"","export default \"layer_icon.svg\"","export default \"LayersIcon.svg\"","export default \"locationIcon.svg\"","export default \"default-property.jpg\""],"names":[],"mappings":";;;;;;;AAAA,gBAAe;;ACAf,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;ACzBA,gBAAe;;ACAf,qBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAf,qBAAe;;ACAf,wBAAe;;ACAf,uBAAe;;ACAf,oBAAe;;ACAf,kBAAe;;ACAf,cAAe;;ACAf,iBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAf,gBAAe;;ACAf,mBAAe;;;;;ACAf,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
package/dist/index.js CHANGED
@@ -91,17 +91,110 @@ function PropertyDetailsHeader(props) {
91
91
  "Grundst\u00FCck")))));
92
92
  }
93
93
 
94
+ var iconArrowRight = "Icon_rightArrow.svg";
95
+
96
+ var blcIconArrowRight = "blackarrow-Right.svg";
97
+
98
+ var blcIconArrowLeft = "blckarrow-Left.svg";
99
+
100
+ var iconArrowLeft = "chevron-left.svg";
101
+
102
+ var iconGallery = "icon_gallery.svg";
103
+
104
+ var iconMap = "icon_map.svg";
105
+
106
+ var iconLayers = "layer_icon.svg";
107
+
94
108
  var css_248z$2 = ".mainImage {\r\n\theight: 80%;\r\n\t\r\n}\r\n\r\n.secondList {\r\n\theight: 20%;\r\n\t\t\r\n\r\n}\r\n\r\n.listImageButton {\r\n\tbackground-color: black;\r\n\talign-items: center !important;\r\n\tjustify-content: center !important;\r\n}\r\n\r\n.listImgText {\r\n\theight: 30px;\r\n\tfont-size: 14px;\r\n\tline-height: 2.14;\r\n\tcolor: #fff;\r\n}\r\n\r\n.arroIconColour {\r\n\theight: 30px;\r\n\tfill: #fff !important;\r\n}\r\n\r\n.onImageArrow {\r\n\twidth: 50px;\r\n\theight: 50px;\r\n\tpadding: 23px 8px;\r\n\tbackground-color: rgba(255, 255, 255, 0.8);\r\n}\r\n\r\n.blackArrow {\r\n\twidth: 20px;\r\n\theight: 20px;\r\n}\r\n\r\n.imagesArray {\r\n\tbackground-size: 'cover' !important;\r\n}\r\n@media (min-width: 800px) {\r\n .Pimagelist {\r\n max-width: 1800px;\r\n \r\n \r\n }\r\n}\r\n\r\n\r\n\r\n\r\n";
95
109
  styleInject(css_248z$2);
96
110
 
97
111
  var css_248z$1 = ".popup-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.7);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 10000;\r\n}\r\n\r\n.popup-container {\r\n background-color: transparent;\r\n border-radius: 8px;\r\n max-width: 90%;\r\n max-height: 90%;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n position: relative;\r\n}\r\n\r\n.popup-header {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n padding: 1rem;\r\n position: absolute;\r\n top: 0;\r\n}\r\n\r\n.popup-title {\r\n color: white;\r\n font-size: 24px;\r\n font-weight: bold;\r\n}\r\n\r\n.btn-close {\r\n position: absolute;\r\n right: 1rem;\r\n top: 1rem;\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 24px;\r\n cursor: pointer;\r\n}\r\n\r\n.popup-body {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 1rem;\r\n position: relative;\r\n flex: 1;\r\n}\r\n\r\n.main-image {\r\n max-width: 100%;\r\n max-height: 80vh;\r\n border-radius: 8px;\r\n}\r\n\r\n.btn-prev,\r\n.btn-next {\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 48px;\r\n cursor: pointer;\r\n position: absolute;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n}\r\n\r\n.btn-prev {\r\n left: 10px;\r\n}\r\n\r\n.btn-next {\r\n right: 10px;\r\n}\r\n\r\n.popup-thumbnails {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 10px;\r\n padding: 1rem;\r\n}\r\n\r\n.thumbnail {\r\n width: 60px;\r\n height: 60px;\r\n object-fit: cover;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n opacity: 0.6;\r\n}\r\n\r\n.thumbnail.active {\r\n border: 2px solid white;\r\n opacity: 1;\r\n}\r\n";
98
112
  styleInject(css_248z$1);
99
113
 
114
+ function ImageListPopup(props) {
115
+ var _a = React.useState(true), showPopUp = _a[0], setShowPopUp = _a[1];
116
+ // const { id } = useParams();
117
+ var _b = React.useState(null); _b[0]; var setMainImage = _b[1];
118
+ var _c = React.useState(0), currentImageIndex = _c[0], setCurrentImageIndex = _c[1];
119
+ // const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
120
+ React.useRef(null);
121
+ // const baseUrl = "https://api-dev.nestiq.de";
122
+ // const pictureUrls = props.property.pictures.map(
123
+ // (picture) => `${baseUrl}${picture.contentUrl}`
124
+ // );
125
+ props.pictureUrls.map(function (pic) {
126
+ return {
127
+ src: pic,
128
+ title: "Not Specified",
129
+ };
130
+ });
131
+ React.useEffect(function () {
132
+ if (props.pictureUrls.length > 0) {
133
+ setMainImage(props.pictureUrls[0]);
134
+ }
135
+ }, [props.pictureUrls]);
136
+ var handleArrowClickInMainImage = function (direction) {
137
+ if (!props.property || props.pictureUrls.length === 0)
138
+ return;
139
+ var newIndex = currentImageIndex;
140
+ if (direction === "left") {
141
+ newIndex =
142
+ (currentImageIndex - 1 + props.pictureUrls.length) %
143
+ props.pictureUrls.length;
144
+ }
145
+ else if (direction === "right") {
146
+ newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
147
+ }
148
+ setCurrentImageIndex(newIndex);
149
+ setMainImage(props.pictureUrls[newIndex]);
150
+ props.imageListRef.current.scrollTo({
151
+ left: newIndex * 150,
152
+ behavior: "smooth",
153
+ });
154
+ };
155
+ var handleClose = function () {
156
+ setShowPopUp(false);
157
+ };
158
+ return (React.createElement("div", null, showPopUp && (React.createElement("div", { className: "popup-overlay" },
159
+ React.createElement("div", { className: " d-flex flex-column col-6 " },
160
+ React.createElement("div", { className: "d-flex align-self-end me-0 ms-5" },
161
+ React.createElement("img", { src: iconClose, alt: "close", className: "closeIcon ", onClick: handleClose })),
162
+ React.createElement("div", { className: "d-flex justify-content-center" },
163
+ React.createElement("div", { className: "p-2 bd-highlight align-self-center align-items-center me-5" },
164
+ React.createElement("div", { className: "rounded-circle border onImageArrow start-0 d-flex ", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
165
+ React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow align-self-center", alt: "Left Arrow" }))),
166
+ React.createElement("div", { className: "p-2 bd-highlight" },
167
+ React.createElement("div", { className: " rounded-5 mainImage ", style: {
168
+ backgroundImage: "url(".concat(props.pictureUrls[currentImageIndex], ")"),
169
+ height: "350px",
170
+ width: "600px",
171
+ backgroundSize: "cover",
172
+ backgroundPosition: "center",
173
+ } })),
174
+ React.createElement("div", { className: "p-2 bd-highlight align-self-center ms-5" },
175
+ " ",
176
+ React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
177
+ React.createElement("img", { src: blcIconArrowRight, className: "blackArrow align-self-center", alt: "Right Arrow" })))),
178
+ React.createElement("div", { className: "d-flex flex-row" }),
179
+ React.createElement("div", { className: "d-flex flex-row gap-4 w-100 secondList " },
180
+ React.createElement("div", { className: "col-lg-12 d-flex flex-row p-1 align-self-center mt-5" },
181
+ React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
182
+ React.createElement("div", { className: "col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto ", ref: props.imageListRef }, props.property && (React.createElement("div", { className: "col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3" }, props.pictureUrls.map(function (imageUrl, index) { return (React.createElement("div", { key: index, className: "col-lg-12 h-100 d-flex", onClick: function () {
183
+ setMainImage(imageUrl);
184
+ setCurrentImageIndex(index);
185
+ props.imageListRef.current.scrollTo({
186
+ left: index * 150,
187
+ behavior: "smooth",
188
+ });
189
+ }, role: "button" },
190
+ React.createElement("img", { src: imageUrl, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); }))))))))))));
191
+ }
192
+
100
193
  function PropertyImageList(prop) {
101
194
  var _a = React.useState(null); _a[0]; var setMainImage = _a[1];
102
- var _b = React.useState(0); _b[0]; _b[1];
103
- var _c = React.useState(false); _c[0]; _c[1];
104
- React.useRef(null);
195
+ var _b = React.useState(0), currentImageIndex = _b[0], setCurrentImageIndex = _b[1];
196
+ var _c = React.useState(false), isImagePopupOpen = _c[0], setIsImagePopupOpen = _c[1];
197
+ var imageListRef = React.useRef(null);
105
198
  var _d = React.useState(false); _d[0]; _d[1];
106
199
  // const [pictureUrls, setPictureUrls] = useState([]);
107
200
  // const baseUrl = "https://api-dev.nestiq.de";
@@ -113,6 +206,70 @@ function PropertyImageList(prop) {
113
206
  setMainImage(prop.pictureUrls[0]);
114
207
  }
115
208
  }, [prop.pictureUrls]);
209
+ var handleArrowClickInMainImage = function (direction) {
210
+ if (!prop.property || prop.pictureUrls.length === 0)
211
+ return;
212
+ var newIndex = currentImageIndex;
213
+ if (direction === "left") {
214
+ newIndex =
215
+ (currentImageIndex - 1 + prop.pictureUrls.length) %
216
+ prop.pictureUrls.length;
217
+ }
218
+ else if (direction === "right") {
219
+ newIndex = (currentImageIndex + 1) % prop.pictureUrls.length;
220
+ }
221
+ setCurrentImageIndex(newIndex);
222
+ setMainImage(prop.pictureUrls[newIndex]);
223
+ };
224
+ var toggleAllPhotos = function () {
225
+ setIsImagePopupOpen(!isImagePopupOpen);
226
+ };
227
+ return (React.createElement("div", { className: "col-8 me-2 Pimagelist" },
228
+ React.createElement("div", { className: "col-12 rounded-5 mainImage d-flex position-relative align-items-center", style: {
229
+ backgroundImage: "url(".concat(prop.pictureUrls[currentImageIndex], ")"),
230
+ backgroundSize: "cover",
231
+ backgroundPosition: "center",
232
+ } },
233
+ React.createElement("div", { className: "rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
234
+ React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow", alt: "Left Arrow" })),
235
+ React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
236
+ React.createElement("img", { src: blcIconArrowRight, className: "blackArrow", alt: "Right Arrow" }))),
237
+ React.createElement("div", { className: "d-flex flex-row gap-1 col-12 secondList" },
238
+ React.createElement("div", { className: "col-lg-6 d-flex flex-row p-1" },
239
+ React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
240
+ React.createElement("div", { className: "col-1 h-100 d-flex position-absolute start-0", onClick: function () { return handleArrowClickInMainImage("left"); }, role: "button" },
241
+ React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
242
+ React.createElement("img", { src: iconArrowLeft, className: "arroIconColour", alt: "Left Arrow" }))),
243
+ React.createElement("div", { className: "col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1", ref: imageListRef }, prop.property && (React.createElement("div", { className: "col-lg-5 h-100 d-flex gap-2 flex-row rounded-3" }, prop.pictureUrls.map(function (imageUrl, index) { return (React.createElement("div", { key: index, className: "col-lg-12 h-100 d-flex", onClick: function () {
244
+ setMainImage(imageUrl);
245
+ setCurrentImageIndex(index);
246
+ prop.imageListRef.current.scrollTo({
247
+ left: index * 150,
248
+ behavior: "smooth",
249
+ });
250
+ }, role: "button" },
251
+ React.createElement("img", { src: imageUrl, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); })))),
252
+ React.createElement("div", { className: "col-1 h-100 d-flex position-absolute end-0 top-0", onClick: function () { return handleArrowClickInMainImage("right"); }, role: "button" },
253
+ React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1" },
254
+ React.createElement("img", { src: iconArrowRight, className: "arroIconColour", alt: "Right Arrow" }))))),
255
+ React.createElement("div", { className: "col-6 d-flex flex-row" },
256
+ React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: toggleAllPhotos },
257
+ React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
258
+ React.createElement("img", { src: iconGallery, alt: "Gallery Icon" }),
259
+ React.createElement("span", { className: "listImgText" }, "Alle Fotos"))),
260
+ React.createElement("div", { className: "col-lg-4 p-1", role: "button" },
261
+ React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
262
+ React.createElement("img", { src: iconLayers, alt: "Layers Icon" }),
263
+ React.createElement("span", { className: "listImgText" }, "Grundriss"))),
264
+ React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: function () {
265
+ return window.scrollTo({
266
+ top: document.documentElement.scrollHeight,
267
+ });
268
+ } },
269
+ React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
270
+ React.createElement("img", { src: iconMap, alt: "Map Icon" }),
271
+ React.createElement("span", { className: "listImgText" }, "Karte"))))),
272
+ isImagePopupOpen && (React.createElement(ImageListPopup, { currentImageIndex: currentImageIndex, handleArrowClickInMainImage: handleArrowClickInMainImage, imageListRef: imageListRef, pictureUrls: prop.pictureUrls, property: prop.property }))));
116
273
  }
117
274
 
118
275
  var layerIcon = "LayersIcon.svg";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/assets/images/icon_close_2.png","../node_modules/style-inject/dist/style-inject.es.js","../src/assets/images/icon_share_1.svg","../src/assets/images/locationIconBlack.svg","../src/assets/Images/LayersIcon.svg","../src/assets/images/locationIcon.svg","../src/assets/Images/default-property.jpg"],"sourcesContent":["export default \"icon_close_2.png\"","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export default \"icon_share_1.svg\"","export default \"locationIconBlack.svg\"","export default \"LayersIcon.svg\"","export default \"locationIcon.svg\"","export default \"default-property.jpg\""],"names":[],"mappings":";;;;;;;;;AAAA,gBAAe;;ACAf,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;ACzBA,gBAAe;;ACAf,qBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAf,gBAAe;;ACAf,mBAAe;;;;;ACAf,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"index.js","sources":["../src/assets/images/icon_close_2.png","../node_modules/style-inject/dist/style-inject.es.js","../src/assets/images/icon_share_1.svg","../src/assets/images/locationIconBlack.svg","../src/assets/Images/Icon_rightArrow.svg","../src/assets/Images/blackarrow-Right.svg","../src/assets/Images/blckarrow-Left.svg","../src/assets/Images/chevron-left.svg","../src/assets/Images/icon_gallery.svg","../src/assets/Images/icon_map.svg","../src/assets/Images/layer_icon.svg","../src/assets/Images/LayersIcon.svg","../src/assets/images/locationIcon.svg","../src/assets/Images/default-property.jpg"],"sourcesContent":["export default \"icon_close_2.png\"","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export default \"icon_share_1.svg\"","export default \"locationIconBlack.svg\"","export default \"Icon_rightArrow.svg\"","export default \"blackarrow-Right.svg\"","export default \"blckarrow-Left.svg\"","export default \"chevron-left.svg\"","export default \"icon_gallery.svg\"","export default \"icon_map.svg\"","export default \"layer_icon.svg\"","export default \"LayersIcon.svg\"","export default \"locationIcon.svg\"","export default \"default-property.jpg\""],"names":[],"mappings":";;;;;;;;;AAAA,gBAAe;;ACAf,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;ACzBA,gBAAe;;ACAf,qBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAf,qBAAe;;ACAf,wBAAe;;ACAf,uBAAe;;ACAf,oBAAe;;ACAf,kBAAe;;ACAf,cAAe;;ACAf,iBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAf,gBAAe;;ACAf,mBAAe;;;;;ACAf,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestiq-component-library",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
@@ -20,14 +20,13 @@ interface PopupProps {
20
20
  askingPrice: string;
21
21
  };
22
22
  pictureUrls: any[];
23
- currentImageIndex: number;
24
- isImagePopupOpen: boolean;
23
+ imageListRef: any;
25
24
  }
26
25
  export default function PropertyImageList(prop: PopupProps) {
27
26
  const [mainImage, setMainImage] = useState(null);
28
27
  const [currentImageIndex, setCurrentImageIndex] = useState(0);
29
28
  const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
30
- const imageListRef = useRef<HTMLDivElement | null>(null);
29
+ const imageListRef = useRef(null);
31
30
  const [open, setopen] = useState<boolean>(false);
32
31
  // const [pictureUrls, setPictureUrls] = useState([]);
33
32
 
@@ -56,163 +55,148 @@ export default function PropertyImageList(prop: PopupProps) {
56
55
  setCurrentImageIndex(newIndex);
57
56
  setMainImage(prop.pictureUrls[newIndex]);
58
57
 
59
- if (imageListRef.current) {
60
- imageListRef.current.scrollTo({
61
- left: newIndex * 150,
62
- behavior: "smooth",
63
- });
64
- }
58
+
59
+ };
65
60
 
66
- const toggleAllPhotos = () => {
67
- setIsImagePopupOpen(!isImagePopupOpen);
68
- };
61
+ const toggleAllPhotos = () => {
62
+ setIsImagePopupOpen(!isImagePopupOpen);
63
+ };
69
64
 
70
- return (
71
- <div className="col-8 me-2 Pimagelist">
65
+ return (
66
+ <div className="col-8 me-2 Pimagelist">
67
+ <div
68
+ className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
69
+ style={{
70
+ backgroundImage: `url(${prop.pictureUrls[currentImageIndex]})`,
71
+ backgroundSize: "cover",
72
+ backgroundPosition: "center",
73
+ }}
74
+ >
75
+ {/* Arrows on the main image */}
72
76
  <div
73
- className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
74
- style={{
75
- backgroundImage: `url(${prop.pictureUrls[currentImageIndex]})`,
76
- backgroundSize: "cover",
77
- backgroundPosition: "center",
78
- }}
77
+ className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
78
+ role="button"
79
+ onClick={() => handleArrowClickInMainImage("left")}
79
80
  >
80
- {/* Arrows on the main image */}
81
- <div
82
- className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
83
- role="button"
84
- onClick={() => handleArrowClickInMainImage("left")}
85
- >
86
- <img
87
- src={blcIconArrowLeft}
88
- className="blackArrow"
89
- alt="Left Arrow"
90
- />
91
- </div>
92
- <div
93
- role="button"
94
- className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
95
- onClick={() => handleArrowClickInMainImage("right")}
96
- >
97
- <img
98
- src={blcIconArrowRight}
99
- className="blackArrow"
100
- alt="Right Arrow"
101
- />
102
- </div>
81
+ <img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
103
82
  </div>
83
+ <div
84
+ role="button"
85
+ className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
86
+ onClick={() => handleArrowClickInMainImage("right")}
87
+ >
88
+ <img
89
+ src={blcIconArrowRight}
90
+ className="blackArrow"
91
+ alt="Right Arrow"
92
+ />
93
+ </div>
94
+ </div>
104
95
 
105
- {/* Image Thumbnails */}
106
- <div className="d-flex flex-row gap-1 col-12 secondList">
107
- <div className="col-lg-6 d-flex flex-row p-1">
108
- <div className="col-12 position-relative d-flex justify-content-center">
109
- <div
110
- className="col-1 h-100 d-flex position-absolute start-0"
111
- onClick={() => handleArrowClickInMainImage("left")}
112
- role="button"
113
- >
114
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
115
- <img
116
- src={iconArrowLeft}
117
- className="arroIconColour"
118
- alt="Left Arrow"
119
- />
120
- </div>
121
- </div>
122
- <div
123
- className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
124
- ref={imageListRef}
125
- >
126
- {prop.property && (
127
- <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
128
- {prop.pictureUrls.map((imageUrl, index) => (
129
- <div
130
- key={index}
131
- className="col-lg-12 h-100 d-flex"
132
- onClick={() => {
133
- setMainImage(imageUrl);
134
- setCurrentImageIndex(index);
135
- if (imageListRef.current) {
136
- imageListRef.current.scrollTo({
137
- left: index * 150,
138
- behavior: "smooth",
139
- });
140
- }
141
- }}
142
- role="button"
143
- >
144
- <img
145
- src={imageUrl}
146
- alt={`Image ${index + 1}`}
147
- className="col-12 h-100 rounded-3 object-fit-cover"
148
- />
149
- </div>
150
- ))}
151
- </div>
152
- )}
153
- </div>
154
- <div
155
- className="col-1 h-100 d-flex position-absolute end-0 top-0"
156
- onClick={() => handleArrowClickInMainImage("right")}
157
- role="button"
158
- >
159
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
160
- <img
161
- src={iconArrowRight}
162
- className="arroIconColour"
163
- alt="Right Arrow"
164
- />
165
- </div>
166
- </div>
167
- </div>
168
- </div>
169
-
170
- {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
171
- <div className="col-6 d-flex flex-row">
96
+ {/* Image Thumbnails */}
97
+ <div className="d-flex flex-row gap-1 col-12 secondList">
98
+ <div className="col-lg-6 d-flex flex-row p-1">
99
+ <div className="col-12 position-relative d-flex justify-content-center">
172
100
  <div
173
- className="col-lg-4 p-1"
101
+ className="col-1 h-100 d-flex position-absolute start-0"
102
+ onClick={() => handleArrowClickInMainImage("left")}
174
103
  role="button"
175
- onClick={toggleAllPhotos}
176
104
  >
177
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
178
- <img src={iconGallery} alt="Gallery Icon" />
179
- <span className="listImgText">Alle Fotos</span>
105
+ <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
106
+ <img
107
+ src={iconArrowLeft}
108
+ className="arroIconColour"
109
+ alt="Left Arrow"
110
+ />
180
111
  </div>
181
112
  </div>
182
- <div className="col-lg-4 p-1" role="button">
183
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
184
- <img src={iconLayers} alt="Layers Icon" />
185
- <span className="listImgText">Grundriss</span>
186
- </div>
113
+ <div
114
+ className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
115
+ ref={imageListRef}
116
+ >
117
+ {prop.property && (
118
+ <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
119
+ {prop.pictureUrls.map((imageUrl, index) => (
120
+ <div
121
+ key={index}
122
+ className="col-lg-12 h-100 d-flex"
123
+ onClick={() => {
124
+ setMainImage(imageUrl);
125
+ setCurrentImageIndex(index);
126
+ prop.imageListRef.current.scrollTo({
127
+ left: index * 150,
128
+ behavior: "smooth",
129
+ });
130
+ }}
131
+ role="button"
132
+ >
133
+ <img
134
+ src={imageUrl}
135
+ alt={`Image ${index + 1}`}
136
+ className="col-12 h-100 rounded-3 object-fit-cover"
137
+ />
138
+ </div>
139
+ ))}
140
+ </div>
141
+ )}
187
142
  </div>
188
143
  <div
189
- className="col-lg-4 p-1"
144
+ className="col-1 h-100 d-flex position-absolute end-0 top-0"
145
+ onClick={() => handleArrowClickInMainImage("right")}
190
146
  role="button"
191
- onClick={() =>
192
- window.scrollTo({
193
- top: document.documentElement.scrollHeight,
194
- })
195
- }
196
147
  >
197
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
198
- <img src={iconMap} alt="Map Icon" />
199
- <span className="listImgText">Karte</span>
148
+ <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
149
+ <img
150
+ src={iconArrowRight}
151
+ className="arroIconColour"
152
+ alt="Right Arrow"
153
+ />
200
154
  </div>
201
155
  </div>
202
156
  </div>
203
157
  </div>
204
158
 
205
- {/* Popup for all photos */}
206
- {isImagePopupOpen && (
207
- <ImageListPopup
208
- currentImageIndex={currentImageIndex}
209
- handleArrowClickInMainImage={handleArrowClickInMainImage}
210
- imageListRef={imageListRef}
211
- pictureUrls={prop.pictureUrls}
212
- property={prop.property}
213
- />
214
- )}
159
+ {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
160
+ <div className="col-6 d-flex flex-row">
161
+ <div className="col-lg-4 p-1" role="button" onClick={toggleAllPhotos}>
162
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
163
+ <img src={iconGallery} alt="Gallery Icon" />
164
+ <span className="listImgText">Alle Fotos</span>
165
+ </div>
166
+ </div>
167
+ <div className="col-lg-4 p-1" role="button">
168
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
169
+ <img src={iconLayers} alt="Layers Icon" />
170
+ <span className="listImgText">Grundriss</span>
171
+ </div>
172
+ </div>
173
+ <div
174
+ className="col-lg-4 p-1"
175
+ role="button"
176
+ onClick={() =>
177
+ window.scrollTo({
178
+ top: document.documentElement.scrollHeight,
179
+ })
180
+ }
181
+ >
182
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
183
+ <img src={iconMap} alt="Map Icon" />
184
+ <span className="listImgText">Karte</span>
185
+ </div>
186
+ </div>
187
+ </div>
215
188
  </div>
216
- );
217
- };
189
+
190
+ {/* Popup for all photos */}
191
+ {isImagePopupOpen && (
192
+ <ImageListPopup
193
+ currentImageIndex={currentImageIndex}
194
+ handleArrowClickInMainImage={handleArrowClickInMainImage}
195
+ imageListRef={imageListRef}
196
+ pictureUrls={prop.pictureUrls}
197
+ property={prop.property}
198
+ />
199
+ )}
200
+ </div>
201
+ );
218
202
  }