nestiq-component-library 1.1.169 → 1.1.171

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.
@@ -37,7 +37,6 @@ interface PopupProps {
37
37
  expose: {
38
38
  title: string;
39
39
  };
40
- selectedFloorPlan?: string;
41
40
  pictures: { contentUrl: string; pictureType: { id: number } }[];
42
41
  };
43
42
  userData?: { firstname: string; lastname: string; company: string };
@@ -83,13 +82,6 @@ export default function PropertyCard(props: PopupProps) {
83
82
  title: `Floor Plan ${index + 1}`,
84
83
  })) || [];
85
84
 
86
- if (props.property.selectedFloorPlan) {
87
- floorPlanImages.push({
88
- url: props.property.selectedFloorPlan,
89
- title: "Selected Floor Plan",
90
- });
91
- }
92
-
93
85
  // setPictureUrls(pictureUrls);
94
86
  const handleLike = () => {
95
87
  setLiked(!liked);
@@ -1,29 +1,29 @@
1
- import React from "react";
2
- import closeIcon from "../../assets/images/icon_close_2.png";
3
- import "./Popup.css";
4
- import "../../styles/common.css";
5
-
6
- interface PopupProps {
7
- children: React.ReactNode;
8
- onCloseClick: () => void;
9
- }
10
-
11
- const Popup: React.FC<PopupProps> = ({ onCloseClick, children }) => {
12
- return (
13
- <div className="popup-overlay">
14
- <div className="shareSection col-12 d-flex position-relative flex-column mx-auto justify-content-center col-5 col-lg-6 d-flex gap-4">
15
- <div className="end-0 top-0 position-absolute ">
16
- <img
17
- src={closeIcon}
18
- alt="close"
19
- className="closeIcon me-2"
20
- onClick={onCloseClick}
21
- />
22
- </div>
23
- {children}
24
- </div>
25
- </div>
26
- );
27
- };
28
-
29
- export default Popup;
1
+ import React from "react";
2
+ import closeIcon from "../../assets/images/icon_close_2.png";
3
+ import "./Popup.css";
4
+ import "../../styles/common.css";
5
+
6
+ interface PopupProps {
7
+ children: React.ReactNode;
8
+ onCloseClick: () => void;
9
+ }
10
+
11
+ const Popup: React.FC<PopupProps> = ({ onCloseClick, children }) => {
12
+ return (
13
+ <div className="popup-overlay">
14
+ <div className="shareSection col-12 d-flex position-relative flex-column mx-auto justify-content-center col-5 col-lg-6 d-flex gap-4">
15
+ <div className="end-0 top-0 position-absolute ">
16
+ <img
17
+ src={closeIcon}
18
+ alt="close"
19
+ className="closeIcon me-2"
20
+ onClick={onCloseClick}
21
+ />
22
+ </div>
23
+ {children}
24
+ </div>
25
+ </div>
26
+ );
27
+ };
28
+
29
+ export default Popup;
@@ -6,6 +6,7 @@ import iconArrowLeft from "../../assets/images/chevron-left.svg";
6
6
  import iconGallery from "../../assets/images/icon_gallery.svg";
7
7
  import iconMap from "../../assets/images/icon_map.svg";
8
8
  import iconLayers from "../../assets/images/layer_icon.svg";
9
+ import noImageIcon from "../../assets/Images/default-property.jpg";
9
10
  import "./PropertyImageList.css";
10
11
  import ImageListPopup from "../ImageListPopup/ImageListPopup";
11
12
  import PopupProps from "../ImageListPopup/ImageListPopup";
@@ -13,7 +14,19 @@ import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
13
14
 
14
15
  interface PopupProps {
15
16
  pictureUrls: { title: string; url: string }[];
16
- floorPlanUrl: string;
17
+ allPictureUrls: { title: string; url: string }[];
18
+ property: {
19
+ pictures: {
20
+ contentUrl: string;
21
+ pictureType: { id: number };
22
+ }[];
23
+ };
24
+ translations?: {
25
+ allPhotos?: string;
26
+ map?: string;
27
+ grundriss?: string;
28
+ };
29
+ baseUrl: string;
17
30
  }
18
31
  export default function PropertyImageList(prop: PopupProps) {
19
32
  const [currentImageIndex, setCurrentImageIndex] = useState(0);
@@ -26,35 +39,50 @@ export default function PropertyImageList(prop: PopupProps) {
26
39
 
27
40
  setCurrentImageIndex((prevIndex) => {
28
41
  let newIndex;
42
+
29
43
  if (direction === "left") {
30
44
  newIndex =
31
45
  (prevIndex - 1 + prop.pictureUrls.length) % prop.pictureUrls.length;
32
- } else if (direction === "right") {
46
+ } else {
33
47
  newIndex = (prevIndex + 1) % prop.pictureUrls.length;
34
48
  }
35
- return newIndex || 0;
36
- });
37
49
 
38
- imageListRef.current!.scrollTo({
39
- left: currentImageIndex * (direction === "left" ? -150 : 150),
40
- behavior: "smooth",
50
+ if (imageListRef.current) {
51
+ imageListRef.current.scrollTo({
52
+ left: newIndex * 150,
53
+ behavior: "smooth",
54
+ });
55
+ }
56
+ return newIndex || 0;
41
57
  });
42
58
  };
43
59
 
60
+ const floorPlanImages =
61
+ prop.property.pictures
62
+ ?.filter((p) => p.pictureType?.id === 1)
63
+ .map((p, index) => ({
64
+ url: prop.baseUrl + p.contentUrl,
65
+ title: `Floor Plan ${index + 1}`,
66
+ })) || [];
67
+
44
68
  const toggleAllPhotos = () => {
45
69
  setIsImagePopupOpen(!isImagePopupOpen);
46
70
  };
47
71
 
48
72
  const floorPlanClickHandler = () => {
49
- if (prop.floorPlanUrl) {
50
- setIsFloorPlanPopupOpen(true);
51
- }
73
+ setIsFloorPlanPopupOpen(true);
52
74
  };
53
75
 
54
76
  const floorPlanPopupCloseHandler = () => {
55
77
  setIsFloorPlanPopupOpen(false);
56
78
  };
57
79
 
80
+ const t = {
81
+ allPhotos: prop.translations?.allPhotos || "Alle Fotos",
82
+ map: prop.translations?.map || "Karte",
83
+ grundriss: prop.translations?.grundriss || "Grundriss",
84
+ };
85
+
58
86
  return (
59
87
  <div className="col-8 Pimagelist ">
60
88
  <div
@@ -168,7 +196,7 @@ export default function PropertyImageList(prop: PopupProps) {
168
196
  >
169
197
  <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
170
198
  <img src={iconGallery} alt="Gallery Icon" />
171
- <span className="listImgText">Alle Fotos</span>
199
+ <span className="listImgText"> {t.allPhotos}</span>
172
200
  </div>
173
201
  </div>
174
202
  <div
@@ -178,7 +206,7 @@ export default function PropertyImageList(prop: PopupProps) {
178
206
  >
179
207
  <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
180
208
  <img src={iconLayers} alt="Layers Icon" />
181
- <span className="listImgText">Grundriss</span>
209
+ <span className="listImgText">{t.grundriss}</span>
182
210
  </div>
183
211
  </div>
184
212
  <div
@@ -192,7 +220,7 @@ export default function PropertyImageList(prop: PopupProps) {
192
220
  >
193
221
  <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
194
222
  <img src={iconMap} alt="Map Icon" />
195
- <span className="listImgText">Karte</span>
223
+ <span className="listImgText">{t.map}</span>
196
224
  </div>
197
225
  </div>
198
226
  </div>
@@ -201,16 +229,16 @@ export default function PropertyImageList(prop: PopupProps) {
201
229
  {/* Popup for all photos */}
202
230
  {isImagePopupOpen && (
203
231
  <ImageListPopup
204
- pictureUrls={prop.pictureUrls}
232
+ pictureUrls={prop.allPictureUrls}
205
233
  onClose={() => setIsImagePopupOpen(false)}
206
234
  />
207
235
  )}
208
236
 
209
237
  {/* Popup for floor plan */}
210
238
  {isFloorPlanPopupOpen && (
211
- <FloorPlanPopup
212
- contentUrl={prop.floorPlanUrl}
213
- onCloseClick={floorPlanPopupCloseHandler}
239
+ <ImageListPopup
240
+ pictureUrls={floorPlanImages}
241
+ onClose={() => setIsFloorPlanPopupOpen(false)}
214
242
  />
215
243
  )}
216
244
  </div>
@@ -1,25 +1,25 @@
1
- import React from "react";
2
- import { ToastContainer, toast } from "react-toastify";
3
-
4
- // Utility function to show a toast
5
- export const showToast = (
6
- message: string,
7
- type: "info" | "success" | "warning" | "error" = "info",
8
- ) => {
9
- toast(message, { type });
10
- };
11
-
12
- const ToastWrapper: React.FC = () => (
13
- <ToastContainer
14
- position="top-right"
15
- autoClose={5000}
16
- hideProgressBar={false}
17
- closeOnClick
18
- rtl={false}
19
- pauseOnFocusLoss
20
- draggable
21
- pauseOnHover
22
- />
23
- );
24
-
25
- export default ToastWrapper;
1
+ import React from "react";
2
+ import { ToastContainer, toast } from "react-toastify";
3
+
4
+ // Utility function to show a toast
5
+ export const showToast = (
6
+ message: string,
7
+ type: "info" | "success" | "warning" | "error" = "info",
8
+ ) => {
9
+ toast(message, { type });
10
+ };
11
+
12
+ const ToastWrapper: React.FC = () => (
13
+ <ToastContainer
14
+ position="top-right"
15
+ autoClose={5000}
16
+ hideProgressBar={false}
17
+ closeOnClick
18
+ rtl={false}
19
+ pauseOnFocusLoss
20
+ draggable
21
+ pauseOnHover
22
+ />
23
+ );
24
+
25
+ export default ToastWrapper;
@@ -1,7 +1,7 @@
1
- export interface MessageModel {
2
- themeId: string;
3
- subject: string;
4
- messageText: string;
5
- firstName: string;
6
- lastName: string;
7
- }
1
+ export interface MessageModel {
2
+ themeId: string;
3
+ subject: string;
4
+ messageText: string;
5
+ firstName: string;
6
+ lastName: string;
7
+ }