nestiq-component-library 1.1.0 → 1.1.1

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.
Files changed (40) hide show
  1. package/dist/assets/images/Icon_rightArrow.svg +3 -0
  2. package/dist/assets/images/LayersIcon.svg +5 -0
  3. package/dist/assets/images/blackarrow-Right.svg +3 -0
  4. package/dist/assets/images/blckarrow-Left.svg +3 -0
  5. package/dist/assets/images/chevron-left.svg +3 -0
  6. package/dist/assets/images/default-property.jpg +0 -0
  7. package/dist/assets/images/heartIcon.svg +3 -0
  8. package/dist/assets/images/icon-close-white.webp +0 -0
  9. package/dist/assets/images/icon_close 2.e41bb9a4db48e048.png +0 -0
  10. package/dist/assets/images/icon_close_2.png +0 -0
  11. package/dist/assets/images/icon_gallery.svg +4 -0
  12. package/dist/assets/images/icon_map.svg +10 -0
  13. package/dist/assets/images/icon_share_1.svg +3 -0
  14. package/dist/assets/images/layer_icon.svg +5 -0
  15. package/dist/assets/images/locationIcon.svg +4 -0
  16. package/dist/assets/images/locationIconBlack.svg +4 -0
  17. package/dist/assets/images/no-image-icon.png +0 -0
  18. package/dist/components/Button/Button.js +6 -0
  19. package/dist/components/ImageListPopup/ImageListPopup.js +26 -0
  20. package/dist/components/Popup/Popup.js +12 -0
  21. package/dist/components/PropertyDetailsHeader/PropertyDetailsHeader.d.ts +1 -1
  22. package/dist/components/SharePopup/PopUp.d.ts +7 -0
  23. package/dist/index.es.js +12 -12
  24. package/dist/index.es.js.map +1 -1
  25. package/dist/index.js +12 -12
  26. package/dist/index.js.map +1 -1
  27. package/package.json +1 -1
  28. package/rollup.config.mjs +35 -35
  29. package/src/components/FloorPlanPopup/FloorPlanPopup.css +3 -3
  30. package/src/components/FloorPlanPopup/FloorPlanPopup.tsx +83 -83
  31. package/src/components/ImageListPopup/ImageListPopup.css +83 -83
  32. package/src/components/ImageListPopup/ImageListPopup.tsx +141 -141
  33. package/src/components/Popup/Popup.tsx +29 -29
  34. package/src/components/PropertyCard/PropertyCard.tsx +136 -136
  35. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +82 -80
  36. package/src/components/PropertyImageList/PropertyImageList.tsx +198 -198
  37. package/src/components/SharePopup/SharePopup.tsx +139 -139
  38. package/src/components/ToastWrapper/ToastWrapper.tsx +25 -25
  39. package/src/functions/util.ts +3 -3
  40. package/src/index.tsx +20 -20
@@ -1,198 +1,198 @@
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: any) => {
25
- if (prop.pictureUrls.length === 0) return;
26
-
27
- let newIndex = currentImageIndex;
28
- if (direction === "left") {
29
- newIndex =
30
- (currentImageIndex - 1 + prop.pictureUrls.length) %
31
- prop.pictureUrls.length;
32
- } else if (direction === "right") {
33
- newIndex = (currentImageIndex + 1) % prop.pictureUrls.length;
34
- }
35
-
36
- setCurrentImageIndex(newIndex);
37
-
38
- imageListRef.current!.scrollTo({
39
- left: newIndex * 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 me-2 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-flex flex-row gap-1 col-12 secondList">
91
- <div className="col-lg-6 d-flex flex-row p-1">
92
- <div className="col-12 position-relative d-flex justify-content-center">
93
- <div
94
- className="col-1 h-100 d-flex position-absolute start-0"
95
- onClick={() => handleArrowClickInMainImage("left")}
96
- role="button"
97
- >
98
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
99
- <img
100
- src={iconArrowLeft}
101
- className="arroIconColour"
102
- alt="Left Arrow"
103
- />
104
- </div>
105
- </div>
106
- <div
107
- className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
108
- ref={imageListRef}
109
- >
110
- {prop.pictureUrls.length > 0 && (
111
- <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
112
- {prop.pictureUrls.map((picture, index) => (
113
- <div
114
- key={index}
115
- className="col-lg-12 h-100 d-flex"
116
- onClick={() => {
117
- setCurrentImageIndex(index);
118
- imageListRef.current!.scrollTo({
119
- left: index * 150,
120
- behavior: "smooth",
121
- });
122
- }}
123
- role="button"
124
- >
125
- <img
126
- src={picture.url}
127
- alt={`Image ${index + 1}`}
128
- className="col-12 h-100 rounded-3 object-fit-cover"
129
- />
130
- </div>
131
- ))}
132
- </div>
133
- )}
134
- </div>
135
- <div
136
- className="col-1 h-100 d-flex position-absolute end-0 top-0"
137
- onClick={() => handleArrowClickInMainImage("right")}
138
- role="button"
139
- >
140
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
141
- <img
142
- src={iconArrowRight}
143
- className="arroIconColour"
144
- alt="Right Arrow"
145
- />
146
- </div>
147
- </div>
148
- </div>
149
- </div>
150
-
151
- {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
152
- <div className="col-6 d-flex flex-row">
153
- <div className="col-lg-4 p-1" role="button" onClick={toggleAllPhotos}>
154
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
155
- <img src={iconGallery} alt="Gallery Icon" />
156
- <span className="listImgText">Alle Fotos</span>
157
- </div>
158
- </div>
159
- <div
160
- className="col-lg-4 p-1"
161
- role="button"
162
- onClick={floorPlanClickHandler}
163
- >
164
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
165
- <img src={iconLayers} alt="Layers Icon" />
166
- <span className="listImgText">Grundriss</span>
167
- </div>
168
- </div>
169
- <div
170
- className="col-lg-4 p-1"
171
- role="button"
172
- onClick={() =>
173
- window.scrollTo({
174
- top: document.documentElement.scrollHeight,
175
- })
176
- }
177
- >
178
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
179
- <img src={iconMap} alt="Map Icon" />
180
- <span className="listImgText">Karte</span>
181
- </div>
182
- </div>
183
- </div>
184
- </div>
185
-
186
- {/* Popup for all photos */}
187
- {isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
188
-
189
- {/* Popup for floor plan */}
190
- {isFloorPlanPopupOpen && (
191
- <FloorPlanPopup
192
- contentUrl={prop.floorPlanUrl}
193
- onCloseClick={floorPlanPopupCloseHandler}
194
- />
195
- )}
196
- </div>
197
- );
198
- }
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: any) => {
25
+ if (prop.pictureUrls.length === 0) return;
26
+
27
+ let newIndex = currentImageIndex;
28
+ if (direction === "left") {
29
+ newIndex =
30
+ (currentImageIndex - 1 + prop.pictureUrls.length) %
31
+ prop.pictureUrls.length;
32
+ } else if (direction === "right") {
33
+ newIndex = (currentImageIndex + 1) % prop.pictureUrls.length;
34
+ }
35
+
36
+ setCurrentImageIndex(newIndex);
37
+
38
+ imageListRef.current!.scrollTo({
39
+ left: newIndex * 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 me-2 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-flex flex-row gap-1 col-12 secondList">
91
+ <div className="col-lg-6 d-flex flex-row p-1">
92
+ <div className="col-12 position-relative d-flex justify-content-center">
93
+ <div
94
+ className="col-1 h-100 d-flex position-absolute start-0"
95
+ onClick={() => handleArrowClickInMainImage("left")}
96
+ role="button"
97
+ >
98
+ <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
99
+ <img
100
+ src={iconArrowLeft}
101
+ className="arroIconColour"
102
+ alt="Left Arrow"
103
+ />
104
+ </div>
105
+ </div>
106
+ <div
107
+ className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
108
+ ref={imageListRef}
109
+ >
110
+ {prop.pictureUrls.length > 0 && (
111
+ <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
112
+ {prop.pictureUrls.map((picture, index) => (
113
+ <div
114
+ key={index}
115
+ className="col-lg-12 h-100 d-flex"
116
+ onClick={() => {
117
+ setCurrentImageIndex(index);
118
+ imageListRef.current!.scrollTo({
119
+ left: index * 150,
120
+ behavior: "smooth",
121
+ });
122
+ }}
123
+ role="button"
124
+ >
125
+ <img
126
+ src={picture.url}
127
+ alt={`Image ${index + 1}`}
128
+ className="col-12 h-100 rounded-3 object-fit-cover"
129
+ />
130
+ </div>
131
+ ))}
132
+ </div>
133
+ )}
134
+ </div>
135
+ <div
136
+ className="col-1 h-100 d-flex position-absolute end-0 top-0"
137
+ onClick={() => handleArrowClickInMainImage("right")}
138
+ role="button"
139
+ >
140
+ <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
141
+ <img
142
+ src={iconArrowRight}
143
+ className="arroIconColour"
144
+ alt="Right Arrow"
145
+ />
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </div>
150
+
151
+ {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
152
+ <div className="col-6 d-flex flex-row">
153
+ <div className="col-lg-4 p-1" role="button" onClick={toggleAllPhotos}>
154
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
155
+ <img src={iconGallery} alt="Gallery Icon" />
156
+ <span className="listImgText">Alle Fotos</span>
157
+ </div>
158
+ </div>
159
+ <div
160
+ className="col-lg-4 p-1"
161
+ role="button"
162
+ onClick={floorPlanClickHandler}
163
+ >
164
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
165
+ <img src={iconLayers} alt="Layers Icon" />
166
+ <span className="listImgText">Grundriss</span>
167
+ </div>
168
+ </div>
169
+ <div
170
+ className="col-lg-4 p-1"
171
+ role="button"
172
+ onClick={() =>
173
+ window.scrollTo({
174
+ top: document.documentElement.scrollHeight,
175
+ })
176
+ }
177
+ >
178
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
179
+ <img src={iconMap} alt="Map Icon" />
180
+ <span className="listImgText">Karte</span>
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ {/* Popup for all photos */}
187
+ {isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
188
+
189
+ {/* Popup for floor plan */}
190
+ {isFloorPlanPopupOpen && (
191
+ <FloorPlanPopup
192
+ contentUrl={prop.floorPlanUrl}
193
+ onCloseClick={floorPlanPopupCloseHandler}
194
+ />
195
+ )}
196
+ </div>
197
+ );
198
+ }