nestiq-component-library 1.1.142 → 1.1.143
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/index.es.js +27 -20
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/nestiq-component-library-1.1.143.tgz +0 -0
- package/package.json +1 -1
- package/src/components/PropertyImageList/PropertyImageList.css +24 -6
- package/src/components/PropertyImageList/PropertyImageList.tsx +213 -206
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
.imagesArray {
|
|
43
|
-
background-size:
|
|
43
|
+
background-size: cover !important;
|
|
44
44
|
}
|
|
45
45
|
@media (max-width: 450px) {
|
|
46
46
|
.Pimagelist {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
width: 58vw;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
@media (min-width: 820px) and (max-width:
|
|
70
|
+
@media (min-width: 820px) and (max-width: 850px) {
|
|
71
71
|
.Pimagelist {
|
|
72
72
|
}
|
|
73
73
|
.mainImage {
|
|
@@ -75,9 +75,27 @@
|
|
|
75
75
|
width: 58vw;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
|
|
79
|
+
.image-thumbnail {
|
|
80
|
+
position: relative;
|
|
81
|
+
transition: opacity 0.3s ease-in-out;
|
|
82
|
+
height: 100%;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.image-thumbnail img {
|
|
89
|
+
height: 100%;
|
|
90
|
+
object-fit: cover;
|
|
91
|
+
border-radius: 8px;
|
|
80
92
|
}
|
|
81
|
-
|
|
82
|
-
|
|
93
|
+
|
|
94
|
+
.image-thumbnail.greyed-out img {
|
|
95
|
+
filter: grayscale(100%) brightness(50%);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.image-thumbnail.selected img {
|
|
99
|
+
filter: none;
|
|
100
|
+
border: 2px solid #007bff; /* Highlight border for selected image */
|
|
83
101
|
}
|
|
@@ -1,206 +1,213 @@
|
|
|
1
|
-
import React, { useRef, useState } from "react";
|
|
2
|
-
import iconArrowRight from "../../assets/images/Icon_rightArrow.svg";
|
|
3
|
-
import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
|
|
4
|
-
import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
|
|
5
|
-
import iconArrowLeft from "../../assets/images/chevron-left.svg";
|
|
6
|
-
import iconGallery from "../../assets/images/icon_gallery.svg";
|
|
7
|
-
import iconMap from "../../assets/images/icon_map.svg";
|
|
8
|
-
import iconLayers from "../../assets/images/layer_icon.svg";
|
|
9
|
-
import "./PropertyImageList.css";
|
|
10
|
-
import ImageListPopup from "../ImageListPopup/ImageListPopup";
|
|
11
|
-
import PopupProps from "../ImageListPopup/ImageListPopup";
|
|
12
|
-
import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
|
|
13
|
-
|
|
14
|
-
interface PopupProps {
|
|
15
|
-
pictureUrls: { title: string; url: string }[];
|
|
16
|
-
floorPlanUrl: string;
|
|
17
|
-
}
|
|
18
|
-
export default function PropertyImageList(prop: PopupProps) {
|
|
19
|
-
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
20
|
-
const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
|
|
21
|
-
const [isFloorPlanPopupOpen, setIsFloorPlanPopupOpen] = useState(false);
|
|
22
|
-
const imageListRef = useRef<HTMLDivElement | null>(null);
|
|
23
|
-
|
|
24
|
-
const handleArrowClickInMainImage = (direction:
|
|
25
|
-
if (prop.pictureUrls.length
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
imageListRef.current!.scrollTo({
|
|
39
|
-
left:
|
|
40
|
-
behavior: "smooth",
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const toggleAllPhotos = () => {
|
|
45
|
-
setIsImagePopupOpen(!isImagePopupOpen);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const floorPlanClickHandler = () => {
|
|
49
|
-
if (prop.floorPlanUrl) {
|
|
50
|
-
setIsFloorPlanPopupOpen(true);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const floorPlanPopupCloseHandler = () => {
|
|
55
|
-
setIsFloorPlanPopupOpen(false);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<div className="col-8 Pimagelist ">
|
|
60
|
-
<div
|
|
61
|
-
className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
|
|
62
|
-
style={{
|
|
63
|
-
backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
|
|
64
|
-
backgroundSize: "cover",
|
|
65
|
-
backgroundPosition: "center",
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
{/* Arrows on the main image */}
|
|
69
|
-
<div
|
|
70
|
-
className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
|
|
71
|
-
role="button"
|
|
72
|
-
onClick={() => handleArrowClickInMainImage("left")}
|
|
73
|
-
>
|
|
74
|
-
<img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
|
|
75
|
-
</div>
|
|
76
|
-
<div
|
|
77
|
-
role="button"
|
|
78
|
-
className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
|
|
79
|
-
onClick={() => handleArrowClickInMainImage("right")}
|
|
80
|
-
>
|
|
81
|
-
<img
|
|
82
|
-
src={blcIconArrowRight}
|
|
83
|
-
className="blackArrow"
|
|
84
|
-
alt="Right Arrow"
|
|
85
|
-
/>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
{/* Image Thumbnails */}
|
|
90
|
-
<div className="d-none d-md-block">
|
|
91
|
-
<div className="mt-1 d-flex flex-row gap-1 col-12
|
|
92
|
-
<div className=" col-lg-6 col-6 d-flex flex-row
|
|
93
|
-
<div className=" col-12 position-relative d-flex justify-content-center">
|
|
94
|
-
<div
|
|
95
|
-
className="col-1 h-100 d-flex position-absolute start-0"
|
|
96
|
-
onClick={() => handleArrowClickInMainImage("left")}
|
|
97
|
-
role="button"
|
|
98
|
-
>
|
|
99
|
-
<div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
100
|
-
<img
|
|
101
|
-
src={iconArrowLeft}
|
|
102
|
-
className="arroIconColour"
|
|
103
|
-
alt="Left Arrow"
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
<div
|
|
108
|
-
className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-
|
|
109
|
-
ref={imageListRef}
|
|
110
|
-
>
|
|
111
|
-
{prop.pictureUrls.length > 0 && (
|
|
112
|
-
<div
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
|
+
import iconArrowRight from "../../assets/images/Icon_rightArrow.svg";
|
|
3
|
+
import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
|
|
4
|
+
import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
|
|
5
|
+
import iconArrowLeft from "../../assets/images/chevron-left.svg";
|
|
6
|
+
import iconGallery from "../../assets/images/icon_gallery.svg";
|
|
7
|
+
import iconMap from "../../assets/images/icon_map.svg";
|
|
8
|
+
import iconLayers from "../../assets/images/layer_icon.svg";
|
|
9
|
+
import "./PropertyImageList.css";
|
|
10
|
+
import ImageListPopup from "../ImageListPopup/ImageListPopup";
|
|
11
|
+
import PopupProps from "../ImageListPopup/ImageListPopup";
|
|
12
|
+
import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
|
|
13
|
+
|
|
14
|
+
interface PopupProps {
|
|
15
|
+
pictureUrls: { title: string; url: string }[];
|
|
16
|
+
floorPlanUrl: string;
|
|
17
|
+
}
|
|
18
|
+
export default function PropertyImageList(prop: PopupProps) {
|
|
19
|
+
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
20
|
+
const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
|
|
21
|
+
const [isFloorPlanPopupOpen, setIsFloorPlanPopupOpen] = useState(false);
|
|
22
|
+
const imageListRef = useRef<HTMLDivElement | null>(null);
|
|
23
|
+
|
|
24
|
+
const handleArrowClickInMainImage = (direction: "left" | "right") => {
|
|
25
|
+
if (!prop.pictureUrls.length) return;
|
|
26
|
+
|
|
27
|
+
setCurrentImageIndex((prevIndex) => {
|
|
28
|
+
let newIndex;
|
|
29
|
+
if (direction === "left") {
|
|
30
|
+
newIndex =
|
|
31
|
+
(prevIndex - 1 + prop.pictureUrls.length) % prop.pictureUrls.length;
|
|
32
|
+
} else if (direction === "right") {
|
|
33
|
+
newIndex = (prevIndex + 1) % prop.pictureUrls.length;
|
|
34
|
+
}
|
|
35
|
+
return newIndex || 0;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
imageListRef.current!.scrollTo({
|
|
39
|
+
left: currentImageIndex * (direction === "left" ? -150 : 150),
|
|
40
|
+
behavior: "smooth",
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const toggleAllPhotos = () => {
|
|
45
|
+
setIsImagePopupOpen(!isImagePopupOpen);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const floorPlanClickHandler = () => {
|
|
49
|
+
if (prop.floorPlanUrl) {
|
|
50
|
+
setIsFloorPlanPopupOpen(true);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const floorPlanPopupCloseHandler = () => {
|
|
55
|
+
setIsFloorPlanPopupOpen(false);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div className="col-8 Pimagelist ">
|
|
60
|
+
<div
|
|
61
|
+
className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
|
|
62
|
+
style={{
|
|
63
|
+
backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
|
|
64
|
+
backgroundSize: "cover",
|
|
65
|
+
backgroundPosition: "center",
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{/* Arrows on the main image */}
|
|
69
|
+
<div
|
|
70
|
+
className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
|
|
71
|
+
role="button"
|
|
72
|
+
onClick={() => handleArrowClickInMainImage("left")}
|
|
73
|
+
>
|
|
74
|
+
<img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
|
|
75
|
+
</div>
|
|
76
|
+
<div
|
|
77
|
+
role="button"
|
|
78
|
+
className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
|
|
79
|
+
onClick={() => handleArrowClickInMainImage("right")}
|
|
80
|
+
>
|
|
81
|
+
<img
|
|
82
|
+
src={blcIconArrowRight}
|
|
83
|
+
className="blackArrow"
|
|
84
|
+
alt="Right Arrow"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
{/* Image Thumbnails */}
|
|
90
|
+
<div className="d-none d-md-block">
|
|
91
|
+
<div className="mt-1 d-flex flex-row gap-1 col-12 secondList">
|
|
92
|
+
<div className=" col-lg-6 col-6 d-flex flex-row py-0 px-1">
|
|
93
|
+
<div className=" col-12 position-relative d-flex justify-content-center">
|
|
94
|
+
<div
|
|
95
|
+
className="col-1 h-100 d-flex position-absolute start-0"
|
|
96
|
+
onClick={() => handleArrowClickInMainImage("left")}
|
|
97
|
+
role="button"
|
|
98
|
+
>
|
|
99
|
+
<div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
100
|
+
<img
|
|
101
|
+
src={iconArrowLeft}
|
|
102
|
+
className="arroIconColour"
|
|
103
|
+
alt="Left Arrow"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div
|
|
108
|
+
className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-hidden"
|
|
109
|
+
ref={imageListRef}
|
|
110
|
+
>
|
|
111
|
+
{prop.pictureUrls.length > 0 && (
|
|
112
|
+
<div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
|
|
113
|
+
{prop.pictureUrls.map((picture, index) => (
|
|
114
|
+
<div
|
|
115
|
+
key={index}
|
|
116
|
+
className={`col-lg-12 h-100 d-flex image-thumbnail ${
|
|
117
|
+
index === currentImageIndex
|
|
118
|
+
? "selected"
|
|
119
|
+
: "greyed-out"
|
|
120
|
+
} ${
|
|
121
|
+
index === 0
|
|
122
|
+
? "ms-1"
|
|
123
|
+
: index === prop.pictureUrls.length - 1
|
|
124
|
+
? "me-1"
|
|
125
|
+
: ""
|
|
126
|
+
}`}
|
|
127
|
+
onClick={() => {
|
|
128
|
+
setCurrentImageIndex(index);
|
|
129
|
+
imageListRef.current!.scrollTo({
|
|
130
|
+
left: index * 150,
|
|
131
|
+
behavior: "smooth",
|
|
132
|
+
});
|
|
133
|
+
}}
|
|
134
|
+
role="button"
|
|
135
|
+
>
|
|
136
|
+
<img
|
|
137
|
+
src={picture.url}
|
|
138
|
+
alt={`Image ${index + 1}`}
|
|
139
|
+
className="col-12 h-100 rounded-3 object-fit-cover"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
))}
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
<div
|
|
147
|
+
className="col-1 h-100 d-flex position-absolute end-0 top-0"
|
|
148
|
+
onClick={() => handleArrowClickInMainImage("right")}
|
|
149
|
+
role="button"
|
|
150
|
+
>
|
|
151
|
+
<div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
152
|
+
<img
|
|
153
|
+
src={iconArrowRight}
|
|
154
|
+
className="arroIconColour "
|
|
155
|
+
alt="Right Arrow"
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
{/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
|
|
163
|
+
<div className="col-7 col-lg-6 d-flex flex-row">
|
|
164
|
+
<div
|
|
165
|
+
className="col-lg-4 col-4 py-0 px-1"
|
|
166
|
+
role="button"
|
|
167
|
+
onClick={toggleAllPhotos}
|
|
168
|
+
>
|
|
169
|
+
<div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
170
|
+
<img src={iconGallery} alt="Gallery Icon" />
|
|
171
|
+
<span className="listImgText">Alle Fotos</span>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
<div
|
|
175
|
+
className="col-lg-4 col-3 py-0 px-1"
|
|
176
|
+
role="button"
|
|
177
|
+
onClick={floorPlanClickHandler}
|
|
178
|
+
>
|
|
179
|
+
<div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
180
|
+
<img src={iconLayers} alt="Layers Icon" />
|
|
181
|
+
<span className="listImgText">Grundriss</span>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
<div
|
|
185
|
+
className="col-lg-4 col-3 py-0 px-1"
|
|
186
|
+
role="button"
|
|
187
|
+
onClick={() =>
|
|
188
|
+
window.scrollTo({
|
|
189
|
+
top: document.documentElement.scrollHeight,
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
>
|
|
193
|
+
<div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
|
|
194
|
+
<img src={iconMap} alt="Map Icon" />
|
|
195
|
+
<span className="listImgText">Karte</span>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
{/* Popup for all photos */}
|
|
202
|
+
{isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
|
|
203
|
+
|
|
204
|
+
{/* Popup for floor plan */}
|
|
205
|
+
{isFloorPlanPopupOpen && (
|
|
206
|
+
<FloorPlanPopup
|
|
207
|
+
contentUrl={prop.floorPlanUrl}
|
|
208
|
+
onCloseClick={floorPlanPopupCloseHandler}
|
|
209
|
+
/>
|
|
210
|
+
)}
|
|
211
|
+
</div>
|
|
212
|
+
);
|
|
213
|
+
}
|