nestiq-component-library 1.1.161 → 1.1.163
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/ImageListPopup/ImageListPopup.d.ts +1 -0
- package/dist/components/NewPropertyCard/NewPropertyCard.d.ts +5 -1
- package/dist/index.es.js +56 -36
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +56 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ImageListPopup/ImageListPopup.css +30 -0
- package/src/components/ImageListPopup/ImageListPopup.tsx +50 -42
- package/src/components/NewPropertyCard/NewPropertyCard.tsx +34 -4
- package/src/components/PropertyImageList/PropertyImageList.tsx +8 -3
- package/nestiq-component-library-1.1.156.tgz +0 -0
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
top: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.closeIconNestiq {
|
|
12
|
+
position: absolute;
|
|
13
|
+
right: 10px;
|
|
14
|
+
top: 10px;
|
|
15
|
+
width: 12px;
|
|
16
|
+
height: 12px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
.popup-title {
|
|
12
22
|
color: white;
|
|
13
23
|
font-size: 24px;
|
|
@@ -81,3 +91,23 @@
|
|
|
81
91
|
border: 2px solid white;
|
|
82
92
|
opacity: 1;
|
|
83
93
|
}
|
|
94
|
+
|
|
95
|
+
.activeStyle {
|
|
96
|
+
border: 3px solid transparent;
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
transition: transform 0.2s ease, border-color 0.2s ease;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.activeStyle:hover {
|
|
103
|
+
transform: scale(1.05);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.activeStyle:focus {
|
|
107
|
+
outline: none;
|
|
108
|
+
transform: scale(1.05);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.activeStyle.active {
|
|
112
|
+
transform: scale(1.05);
|
|
113
|
+
}
|
|
@@ -7,6 +7,7 @@ import "../../styles/common.css";
|
|
|
7
7
|
|
|
8
8
|
interface PopupProps {
|
|
9
9
|
pictureUrls: { title: string; url: string }[];
|
|
10
|
+
onClose?: () => void;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export default function ImageListPopup(props: PopupProps) {
|
|
@@ -35,7 +36,9 @@ export default function ImageListPopup(props: PopupProps) {
|
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
const handleClose = () => {
|
|
38
|
-
|
|
39
|
+
if (props.onClose) {
|
|
40
|
+
props.onClose();
|
|
41
|
+
}
|
|
39
42
|
};
|
|
40
43
|
|
|
41
44
|
return (
|
|
@@ -47,7 +50,7 @@ export default function ImageListPopup(props: PopupProps) {
|
|
|
47
50
|
<img
|
|
48
51
|
src={iconClose}
|
|
49
52
|
alt="close"
|
|
50
|
-
className="
|
|
53
|
+
className="closeIconNestiq"
|
|
51
54
|
onClick={handleClose}
|
|
52
55
|
/>
|
|
53
56
|
</div>
|
|
@@ -57,7 +60,7 @@ export default function ImageListPopup(props: PopupProps) {
|
|
|
57
60
|
<div className="d-flex justify-content-center">
|
|
58
61
|
<div className="p-2 bd-highlight align-self-center align-items-center me-5">
|
|
59
62
|
<div
|
|
60
|
-
className="rounded-circle border onImageArrow
|
|
63
|
+
className="rounded-circle border onImageArrow d-flex justify-content-center"
|
|
61
64
|
role="button"
|
|
62
65
|
onClick={() => handleArrowClickInMainImage("left")}
|
|
63
66
|
>
|
|
@@ -70,7 +73,7 @@ export default function ImageListPopup(props: PopupProps) {
|
|
|
70
73
|
</div>
|
|
71
74
|
<div className="p-2 bd-highlight">
|
|
72
75
|
<div
|
|
73
|
-
className=" rounded-5
|
|
76
|
+
className=" rounded-5"
|
|
74
77
|
style={{
|
|
75
78
|
backgroundImage: `url(${props.pictureUrls[currentImageIndex].url})`,
|
|
76
79
|
height: "465px",
|
|
@@ -84,7 +87,7 @@ export default function ImageListPopup(props: PopupProps) {
|
|
|
84
87
|
{" "}
|
|
85
88
|
<div
|
|
86
89
|
role="button"
|
|
87
|
-
className="rounded-circle border onImageArrow d-flex
|
|
90
|
+
className="rounded-circle border onImageArrow d-flex justify-content-center"
|
|
88
91
|
onClick={() => handleArrowClickInMainImage("right")}
|
|
89
92
|
>
|
|
90
93
|
<img
|
|
@@ -98,44 +101,49 @@ export default function ImageListPopup(props: PopupProps) {
|
|
|
98
101
|
<div className="d-flex flex-row">
|
|
99
102
|
{/* Arrows on the main image */}
|
|
100
103
|
</div>
|
|
101
|
-
<div className="d-flex flex-row
|
|
102
|
-
<div
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
104
|
+
<div className="d-flex flex-row justify-content-center w-100 mt-5">
|
|
105
|
+
<div
|
|
106
|
+
className="d-flex flex-row gap-4 overflow-auto px-3"
|
|
107
|
+
ref={imageListRef}
|
|
108
|
+
style={{
|
|
109
|
+
maxWidth: "100%",
|
|
110
|
+
scrollbarWidth: "thin",
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{props.pictureUrls.length > 0 && (
|
|
114
|
+
<>
|
|
115
|
+
{props.pictureUrls.map((picture, index) => (
|
|
116
|
+
<div
|
|
117
|
+
key={index}
|
|
118
|
+
className={`flex-shrink-0 activeStyle ${
|
|
119
|
+
index === currentImageIndex ? "active" : ""
|
|
120
|
+
}`}
|
|
121
|
+
onClick={() => {
|
|
122
|
+
setCurrentImageIndex(index);
|
|
123
|
+
imageListRef.current!.scrollTo({
|
|
124
|
+
left: index * 170, // 150px width + gap
|
|
125
|
+
behavior: "smooth",
|
|
126
|
+
});
|
|
127
|
+
}}
|
|
128
|
+
role="button"
|
|
129
|
+
style={{
|
|
130
|
+
cursor: "pointer",
|
|
131
|
+
width: "150px",
|
|
132
|
+
height: "150px",
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<img
|
|
136
|
+
src={picture.url}
|
|
137
|
+
alt={`Image ${index + 1}`}
|
|
138
|
+
className="w-100 h-100 rounded-3 object-fit-cover"
|
|
139
|
+
style={{
|
|
140
|
+
display: "block",
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
135
143
|
</div>
|
|
136
|
-
)}
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
))}
|
|
145
|
+
</>
|
|
146
|
+
)}
|
|
139
147
|
</div>
|
|
140
148
|
</div>
|
|
141
149
|
</div>
|
|
@@ -14,6 +14,7 @@ import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
|
|
|
14
14
|
import SharePopup from "../SharePopup/SharePopup";
|
|
15
15
|
import { MessageModel } from "../../models/message.model";
|
|
16
16
|
import immooly from "../../assets/images/imooly.svg";
|
|
17
|
+
import ImageListPopup from "../ImageListPopup/ImageListPopup";
|
|
17
18
|
|
|
18
19
|
interface PopupProps {
|
|
19
20
|
property: {
|
|
@@ -36,6 +37,7 @@ interface PopupProps {
|
|
|
36
37
|
expose: {
|
|
37
38
|
title: string;
|
|
38
39
|
};
|
|
40
|
+
selectedFloorPlan?: string;
|
|
39
41
|
pictures: { contentUrl: string; pictureType: { id: number } }[];
|
|
40
42
|
};
|
|
41
43
|
Impliment: any;
|
|
@@ -46,7 +48,7 @@ interface PopupProps {
|
|
|
46
48
|
messageOnClick: () => void;
|
|
47
49
|
onclickSuccess: () => void;
|
|
48
50
|
onClick: () => void;
|
|
49
|
-
onFloorPlanClick: () => void;
|
|
51
|
+
onFloorPlanClick: (images: { url: string; title: string }[]) => void;
|
|
50
52
|
}
|
|
51
53
|
export default function PropertyCard(props: PopupProps) {
|
|
52
54
|
const [liked, setLiked] = useState(false);
|
|
@@ -57,6 +59,8 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
57
59
|
const [messagePopUp, setMessagPopUp] = useState(false);
|
|
58
60
|
const [sharePopUp, setSharePopUp] = useState(false);
|
|
59
61
|
|
|
62
|
+
const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
|
|
63
|
+
|
|
60
64
|
const pictureUrls =
|
|
61
65
|
props.property?.pictures?.length > 0
|
|
62
66
|
? props.property.pictures
|
|
@@ -64,13 +68,33 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
64
68
|
.map((picture) => `${props.baseUrl}${picture.contentUrl}`)
|
|
65
69
|
: [noImageIcon];
|
|
66
70
|
|
|
71
|
+
const floorPlanImages =
|
|
72
|
+
props.property.pictures
|
|
73
|
+
?.filter((p) => p.pictureType?.id === 1)
|
|
74
|
+
.map((p, index) => ({
|
|
75
|
+
url: props.baseUrl + p.contentUrl,
|
|
76
|
+
title: `Floor Plan ${index + 1}`,
|
|
77
|
+
})) || [];
|
|
78
|
+
|
|
79
|
+
if (props.property.selectedFloorPlan) {
|
|
80
|
+
floorPlanImages.push({
|
|
81
|
+
url: props.property.selectedFloorPlan,
|
|
82
|
+
title: "Selected Floor Plan",
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
67
86
|
// setPictureUrls(pictureUrls);
|
|
68
87
|
const handleLike = () => {
|
|
69
88
|
setLiked(!liked);
|
|
70
89
|
};
|
|
71
|
-
|
|
72
|
-
|
|
90
|
+
|
|
91
|
+
const handleFloorPlanButton = () => {
|
|
92
|
+
setIsImagePopupOpen(true);
|
|
93
|
+
if (props.onFloorPlanClick) {
|
|
94
|
+
props.onFloorPlanClick(floorPlanImages);
|
|
95
|
+
}
|
|
73
96
|
};
|
|
97
|
+
|
|
74
98
|
const handleMessagPopUp = () => {
|
|
75
99
|
// setMessagPopUp(true);
|
|
76
100
|
props.messageOnClick();
|
|
@@ -146,7 +170,7 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
146
170
|
<div
|
|
147
171
|
className="Grundriss kontact-button-text ms-2 "
|
|
148
172
|
role="button"
|
|
149
|
-
onClick={
|
|
173
|
+
onClick={() => handleFloorPlanButton()}
|
|
150
174
|
style={{ marginBottom: "16px" }}
|
|
151
175
|
>
|
|
152
176
|
<img src={iconLayers} className="" style={{ width: "18px" }} />{" "}
|
|
@@ -355,6 +379,12 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
355
379
|
/>
|
|
356
380
|
)} */}
|
|
357
381
|
{sharePopUp && <SharePopup onClick={() => setSharePopUp(false)} />}
|
|
382
|
+
{isImagePopupOpen && (
|
|
383
|
+
<ImageListPopup
|
|
384
|
+
pictureUrls={floorPlanImages}
|
|
385
|
+
onClose={() => setIsImagePopupOpen(false)}
|
|
386
|
+
/>
|
|
387
|
+
)}
|
|
358
388
|
</div>
|
|
359
389
|
);
|
|
360
390
|
}
|
|
@@ -121,8 +121,8 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
121
121
|
index === 0
|
|
122
122
|
? "ms-1"
|
|
123
123
|
: index === prop.pictureUrls.length - 1
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
? "me-1"
|
|
125
|
+
: ""
|
|
126
126
|
}`}
|
|
127
127
|
onClick={() => {
|
|
128
128
|
setCurrentImageIndex(index);
|
|
@@ -199,7 +199,12 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
199
199
|
</div>
|
|
200
200
|
</div>
|
|
201
201
|
{/* Popup for all photos */}
|
|
202
|
-
{isImagePopupOpen &&
|
|
202
|
+
{isImagePopupOpen && (
|
|
203
|
+
<ImageListPopup
|
|
204
|
+
pictureUrls={prop.pictureUrls}
|
|
205
|
+
onClose={() => setIsImagePopupOpen(false)}
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
203
208
|
|
|
204
209
|
{/* Popup for floor plan */}
|
|
205
210
|
{isFloorPlanPopupOpen && (
|
|
Binary file
|