nestiq-component-library 1.0.23 → 1.0.24
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/PropertyImageList/PropertyImageList.d.ts +3 -1
- package/dist/index.es.js +164 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +164 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/PropertyImageList/PropertyImageList.tsx +129 -139
|
@@ -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 {
|
|
@@ -10,7 +11,8 @@ interface PopupProps {
|
|
|
10
11
|
};
|
|
11
12
|
pictureUrls: any[];
|
|
12
13
|
currentImageIndex: number;
|
|
14
|
+
imageListRef: any;
|
|
13
15
|
isImagePopupOpen: boolean;
|
|
14
16
|
}
|
|
15
|
-
export default function PropertyImageList(prop: PopupProps):
|
|
17
|
+
export default function PropertyImageList(prop: PopupProps): React.JSX.Element;
|
|
16
18
|
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)
|
|
101
|
-
var _c = useState(false)
|
|
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,74 @@ 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
|
+
prop.imageListRef.current.scrollTo({
|
|
222
|
+
left: newIndex * 150,
|
|
223
|
+
behavior: "smooth",
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
var toggleAllPhotos = function () {
|
|
227
|
+
setIsImagePopupOpen(!isImagePopupOpen);
|
|
228
|
+
};
|
|
229
|
+
return (React.createElement("div", { className: "col-8 me-2 Pimagelist" },
|
|
230
|
+
React.createElement("div", { className: "col-12 rounded-5 mainImage d-flex position-relative align-items-center", style: {
|
|
231
|
+
backgroundImage: "url(".concat(prop.pictureUrls[currentImageIndex], ")"),
|
|
232
|
+
backgroundSize: "cover",
|
|
233
|
+
backgroundPosition: "center",
|
|
234
|
+
} },
|
|
235
|
+
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"); } },
|
|
236
|
+
React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow", alt: "Left Arrow" })),
|
|
237
|
+
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"); } },
|
|
238
|
+
React.createElement("img", { src: blcIconArrowRight, className: "blackArrow", alt: "Right Arrow" }))),
|
|
239
|
+
React.createElement("div", { className: "d-flex flex-row gap-1 col-12 secondList" },
|
|
240
|
+
React.createElement("div", { className: "col-lg-6 d-flex flex-row p-1" },
|
|
241
|
+
React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
|
|
242
|
+
React.createElement("div", { className: "col-1 h-100 d-flex position-absolute start-0", onClick: function () { return handleArrowClickInMainImage("left"); }, role: "button" },
|
|
243
|
+
React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
244
|
+
React.createElement("img", { src: iconArrowLeft, className: "arroIconColour", alt: "Left Arrow" }))),
|
|
245
|
+
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 () {
|
|
246
|
+
setMainImage(imageUrl);
|
|
247
|
+
setCurrentImageIndex(index);
|
|
248
|
+
prop.imageListRef.current.scrollTo({
|
|
249
|
+
left: index * 150,
|
|
250
|
+
behavior: "smooth",
|
|
251
|
+
});
|
|
252
|
+
}, role: "button" },
|
|
253
|
+
React.createElement("img", { src: imageUrl, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); })))),
|
|
254
|
+
React.createElement("div", { className: "col-1 h-100 d-flex position-absolute end-0 top-0", onClick: function () { return handleArrowClickInMainImage("right"); }, role: "button" },
|
|
255
|
+
React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1" },
|
|
256
|
+
React.createElement("img", { src: iconArrowRight, className: "arroIconColour", alt: "Right Arrow" }))))),
|
|
257
|
+
React.createElement("div", { className: "col-6 d-flex flex-row" },
|
|
258
|
+
React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: toggleAllPhotos },
|
|
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: iconGallery, alt: "Gallery Icon" }),
|
|
261
|
+
React.createElement("span", { className: "listImgText" }, "Alle Fotos"))),
|
|
262
|
+
React.createElement("div", { className: "col-lg-4 p-1", role: "button" },
|
|
263
|
+
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
264
|
+
React.createElement("img", { src: iconLayers, alt: "Layers Icon" }),
|
|
265
|
+
React.createElement("span", { className: "listImgText" }, "Grundriss"))),
|
|
266
|
+
React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: function () {
|
|
267
|
+
return window.scrollTo({
|
|
268
|
+
top: document.documentElement.scrollHeight,
|
|
269
|
+
});
|
|
270
|
+
} },
|
|
271
|
+
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
272
|
+
React.createElement("img", { src: iconMap, alt: "Map Icon" }),
|
|
273
|
+
React.createElement("span", { className: "listImgText" }, "Karte"))))),
|
|
274
|
+
isImagePopupOpen && (React.createElement(ImageListPopup, { currentImageIndex: currentImageIndex, handleArrowClickInMainImage: handleArrowClickInMainImage, imageListRef: imageListRef, pictureUrls: prop.pictureUrls, property: prop.property }))));
|
|
114
275
|
}
|
|
115
276
|
|
|
116
277
|
var layerIcon = "LayersIcon.svg";
|
package/dist/index.es.js.map
CHANGED
|
@@ -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
|
|
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)
|
|
103
|
-
var _c = React.useState(false)
|
|
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,74 @@ 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
|
+
prop.imageListRef.current.scrollTo({
|
|
224
|
+
left: newIndex * 150,
|
|
225
|
+
behavior: "smooth",
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
var toggleAllPhotos = function () {
|
|
229
|
+
setIsImagePopupOpen(!isImagePopupOpen);
|
|
230
|
+
};
|
|
231
|
+
return (React.createElement("div", { className: "col-8 me-2 Pimagelist" },
|
|
232
|
+
React.createElement("div", { className: "col-12 rounded-5 mainImage d-flex position-relative align-items-center", style: {
|
|
233
|
+
backgroundImage: "url(".concat(prop.pictureUrls[currentImageIndex], ")"),
|
|
234
|
+
backgroundSize: "cover",
|
|
235
|
+
backgroundPosition: "center",
|
|
236
|
+
} },
|
|
237
|
+
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"); } },
|
|
238
|
+
React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow", alt: "Left Arrow" })),
|
|
239
|
+
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"); } },
|
|
240
|
+
React.createElement("img", { src: blcIconArrowRight, className: "blackArrow", alt: "Right Arrow" }))),
|
|
241
|
+
React.createElement("div", { className: "d-flex flex-row gap-1 col-12 secondList" },
|
|
242
|
+
React.createElement("div", { className: "col-lg-6 d-flex flex-row p-1" },
|
|
243
|
+
React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
|
|
244
|
+
React.createElement("div", { className: "col-1 h-100 d-flex position-absolute start-0", onClick: function () { return handleArrowClickInMainImage("left"); }, role: "button" },
|
|
245
|
+
React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
246
|
+
React.createElement("img", { src: iconArrowLeft, className: "arroIconColour", alt: "Left Arrow" }))),
|
|
247
|
+
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 () {
|
|
248
|
+
setMainImage(imageUrl);
|
|
249
|
+
setCurrentImageIndex(index);
|
|
250
|
+
prop.imageListRef.current.scrollTo({
|
|
251
|
+
left: index * 150,
|
|
252
|
+
behavior: "smooth",
|
|
253
|
+
});
|
|
254
|
+
}, role: "button" },
|
|
255
|
+
React.createElement("img", { src: imageUrl, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); })))),
|
|
256
|
+
React.createElement("div", { className: "col-1 h-100 d-flex position-absolute end-0 top-0", onClick: function () { return handleArrowClickInMainImage("right"); }, role: "button" },
|
|
257
|
+
React.createElement("div", { className: "col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1" },
|
|
258
|
+
React.createElement("img", { src: iconArrowRight, className: "arroIconColour", alt: "Right Arrow" }))))),
|
|
259
|
+
React.createElement("div", { className: "col-6 d-flex flex-row" },
|
|
260
|
+
React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: toggleAllPhotos },
|
|
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: iconGallery, alt: "Gallery Icon" }),
|
|
263
|
+
React.createElement("span", { className: "listImgText" }, "Alle Fotos"))),
|
|
264
|
+
React.createElement("div", { className: "col-lg-4 p-1", role: "button" },
|
|
265
|
+
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
266
|
+
React.createElement("img", { src: iconLayers, alt: "Layers Icon" }),
|
|
267
|
+
React.createElement("span", { className: "listImgText" }, "Grundriss"))),
|
|
268
|
+
React.createElement("div", { className: "col-lg-4 p-1", role: "button", onClick: function () {
|
|
269
|
+
return window.scrollTo({
|
|
270
|
+
top: document.documentElement.scrollHeight,
|
|
271
|
+
});
|
|
272
|
+
} },
|
|
273
|
+
React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
|
|
274
|
+
React.createElement("img", { src: iconMap, alt: "Map Icon" }),
|
|
275
|
+
React.createElement("span", { className: "listImgText" }, "Karte"))))),
|
|
276
|
+
isImagePopupOpen && (React.createElement(ImageListPopup, { currentImageIndex: currentImageIndex, handleArrowClickInMainImage: handleArrowClickInMainImage, imageListRef: imageListRef, pictureUrls: prop.pictureUrls, property: prop.property }))));
|
|
116
277
|
}
|
|
117
278
|
|
|
118
279
|
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
|
|
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
|
@@ -18,16 +18,18 @@ interface PopupProps {
|
|
|
18
18
|
rooms: string;
|
|
19
19
|
propertyArea: string;
|
|
20
20
|
askingPrice: string;
|
|
21
|
+
|
|
21
22
|
};
|
|
22
23
|
pictureUrls: any[];
|
|
23
24
|
currentImageIndex: number;
|
|
25
|
+
imageListRef: any;
|
|
24
26
|
isImagePopupOpen: boolean;
|
|
25
27
|
}
|
|
26
28
|
export default function PropertyImageList(prop: PopupProps) {
|
|
27
29
|
const [mainImage, setMainImage] = useState(null);
|
|
28
30
|
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
29
31
|
const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
|
|
30
|
-
const imageListRef = useRef
|
|
32
|
+
const imageListRef = useRef(null);
|
|
31
33
|
const [open, setopen] = useState<boolean>(false);
|
|
32
34
|
// const [pictureUrls, setPictureUrls] = useState([]);
|
|
33
35
|
|
|
@@ -56,163 +58,151 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
56
58
|
setCurrentImageIndex(newIndex);
|
|
57
59
|
setMainImage(prop.pictureUrls[newIndex]);
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
61
|
+
prop.imageListRef.current.scrollTo({
|
|
62
|
+
left: newIndex * 150,
|
|
63
|
+
behavior: "smooth",
|
|
64
|
+
});
|
|
65
|
+
};
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const toggleAllPhotos = () => {
|
|
68
|
+
setIsImagePopupOpen(!isImagePopupOpen);
|
|
69
|
+
};
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
return (
|
|
72
|
+
<div className="col-8 me-2 Pimagelist">
|
|
73
|
+
<div
|
|
74
|
+
className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
|
|
75
|
+
style={{
|
|
76
|
+
backgroundImage: `url(${prop.pictureUrls[currentImageIndex]})`,
|
|
77
|
+
backgroundSize: "cover",
|
|
78
|
+
backgroundPosition: "center",
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{/* Arrows on the main image */}
|
|
72
82
|
<div
|
|
73
|
-
className="
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
backgroundSize: "cover",
|
|
77
|
-
backgroundPosition: "center",
|
|
78
|
-
}}
|
|
83
|
+
className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
|
|
84
|
+
role="button"
|
|
85
|
+
onClick={() => handleArrowClickInMainImage("left")}
|
|
79
86
|
>
|
|
80
|
-
{
|
|
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>
|
|
87
|
+
<img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
|
|
103
88
|
</div>
|
|
89
|
+
<div
|
|
90
|
+
role="button"
|
|
91
|
+
className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
|
|
92
|
+
onClick={() => handleArrowClickInMainImage("right")}
|
|
93
|
+
>
|
|
94
|
+
<img
|
|
95
|
+
src={blcIconArrowRight}
|
|
96
|
+
className="blackArrow"
|
|
97
|
+
alt="Right Arrow"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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">
|
|
102
|
+
{/* Image Thumbnails */}
|
|
103
|
+
<div className="d-flex flex-row gap-1 col-12 secondList">
|
|
104
|
+
<div className="col-lg-6 d-flex flex-row p-1">
|
|
105
|
+
<div className="col-12 position-relative d-flex justify-content-center">
|
|
172
106
|
<div
|
|
173
|
-
className="col-
|
|
107
|
+
className="col-1 h-100 d-flex position-absolute start-0"
|
|
108
|
+
onClick={() => handleArrowClickInMainImage("left")}
|
|
174
109
|
role="button"
|
|
175
|
-
onClick={toggleAllPhotos}
|
|
176
110
|
>
|
|
177
|
-
<div className="
|
|
178
|
-
<img
|
|
179
|
-
|
|
111
|
+
<div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
112
|
+
<img
|
|
113
|
+
src={iconArrowLeft}
|
|
114
|
+
className="arroIconColour"
|
|
115
|
+
alt="Left Arrow"
|
|
116
|
+
/>
|
|
180
117
|
</div>
|
|
181
118
|
</div>
|
|
182
|
-
<div
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
119
|
+
<div
|
|
120
|
+
className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
|
|
121
|
+
ref={imageListRef}
|
|
122
|
+
>
|
|
123
|
+
{prop.property && (
|
|
124
|
+
<div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
|
|
125
|
+
{prop.pictureUrls.map((imageUrl, index) => (
|
|
126
|
+
<div
|
|
127
|
+
key={index}
|
|
128
|
+
className="col-lg-12 h-100 d-flex"
|
|
129
|
+
onClick={() => {
|
|
130
|
+
setMainImage(imageUrl);
|
|
131
|
+
setCurrentImageIndex(index);
|
|
132
|
+
prop.imageListRef.current.scrollTo({
|
|
133
|
+
left: index * 150,
|
|
134
|
+
behavior: "smooth",
|
|
135
|
+
});
|
|
136
|
+
}}
|
|
137
|
+
role="button"
|
|
138
|
+
>
|
|
139
|
+
<img
|
|
140
|
+
src={imageUrl}
|
|
141
|
+
alt={`Image ${index + 1}`}
|
|
142
|
+
className="col-12 h-100 rounded-3 object-fit-cover"
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
187
148
|
</div>
|
|
188
149
|
<div
|
|
189
|
-
className="col-
|
|
150
|
+
className="col-1 h-100 d-flex position-absolute end-0 top-0"
|
|
151
|
+
onClick={() => handleArrowClickInMainImage("right")}
|
|
190
152
|
role="button"
|
|
191
|
-
onClick={() =>
|
|
192
|
-
window.scrollTo({
|
|
193
|
-
top: document.documentElement.scrollHeight,
|
|
194
|
-
})
|
|
195
|
-
}
|
|
196
153
|
>
|
|
197
|
-
<div className="
|
|
198
|
-
<img
|
|
199
|
-
|
|
154
|
+
<div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
|
|
155
|
+
<img
|
|
156
|
+
src={iconArrowRight}
|
|
157
|
+
className="arroIconColour"
|
|
158
|
+
alt="Right Arrow"
|
|
159
|
+
/>
|
|
200
160
|
</div>
|
|
201
161
|
</div>
|
|
202
162
|
</div>
|
|
203
163
|
</div>
|
|
204
164
|
|
|
205
|
-
{/*
|
|
206
|
-
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
165
|
+
{/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
|
|
166
|
+
<div className="col-6 d-flex flex-row">
|
|
167
|
+
<div className="col-lg-4 p-1" role="button" onClick={toggleAllPhotos}>
|
|
168
|
+
<div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
169
|
+
<img src={iconGallery} alt="Gallery Icon" />
|
|
170
|
+
<span className="listImgText">Alle Fotos</span>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
<div className="col-lg-4 p-1" role="button">
|
|
174
|
+
<div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
175
|
+
<img src={iconLayers} alt="Layers Icon" />
|
|
176
|
+
<span className="listImgText">Grundriss</span>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
<div
|
|
180
|
+
className="col-lg-4 p-1"
|
|
181
|
+
role="button"
|
|
182
|
+
onClick={() =>
|
|
183
|
+
window.scrollTo({
|
|
184
|
+
top: document.documentElement.scrollHeight,
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
<div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
189
|
+
<img src={iconMap} alt="Map Icon" />
|
|
190
|
+
<span className="listImgText">Karte</span>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
215
194
|
</div>
|
|
216
|
-
|
|
217
|
-
|
|
195
|
+
|
|
196
|
+
{/* Popup for all photos */}
|
|
197
|
+
{isImagePopupOpen && (
|
|
198
|
+
<ImageListPopup
|
|
199
|
+
currentImageIndex={currentImageIndex}
|
|
200
|
+
handleArrowClickInMainImage={handleArrowClickInMainImage}
|
|
201
|
+
imageListRef={imageListRef}
|
|
202
|
+
pictureUrls={prop.pictureUrls}
|
|
203
|
+
property={prop.property}
|
|
204
|
+
/>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
218
208
|
}
|