nestiq-component-library 1.0.25 → 1.0.26

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 (35) hide show
  1. package/dist/components/ImageListPopup/ImageListPopup.d.ts +4 -11
  2. package/dist/components/PropertyDetailsHeader/PropertyDetailsHeader.d.ts +1 -1
  3. package/dist/components/PropertyImageList/PropertyImageList.d.ts +4 -9
  4. package/dist/index.es.js +43 -70
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.js +42 -69
  7. package/dist/index.js.map +1 -1
  8. package/package.json +3 -7
  9. package/rollup.config.mjs +35 -40
  10. package/src/components/ImageListPopup/ImageListPopup.css +107 -107
  11. package/src/components/ImageListPopup/ImageListPopup.tsx +141 -212
  12. package/src/components/Popup/Popup.tsx +28 -28
  13. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +83 -82
  14. package/src/components/PropertyImageList/PropertyImageList.tsx +14 -43
  15. package/tsconfig.json +2 -0
  16. package/dist/assets/images/heartIcon.svg +0 -3
  17. package/dist/assets/images/icon-close-white.webp +0 -0
  18. package/dist/assets/images/no-image-icon.png +0 -0
  19. package/dist/components/Button/Button.js +0 -6
  20. package/dist/components/ImageListPopup/ImageListPopup.js +0 -26
  21. package/dist/components/Popup/Popup.js +0 -12
  22. package/nestiq-component-library-1.0.22.tgz +0 -0
  23. /package/dist/assets/images/{Icon_rightArrow.svg → Icon_rightArrow.bced4a705c07148d.svg} +0 -0
  24. /package/dist/assets/images/{LayersIcon.svg → LayersIcon.34c085c352a2c9c8.svg} +0 -0
  25. /package/dist/assets/images/{blackarrow-Right.svg → blackarrow-Right.e585ae62dd55abae.svg} +0 -0
  26. /package/dist/assets/images/{blckarrow-Left.svg → blckarrow-Left.e2134741aa368d30.svg} +0 -0
  27. /package/dist/assets/images/{chevron-left.svg → chevron-left.04f0a7f16b745c1a.svg} +0 -0
  28. /package/dist/assets/images/{default-property.jpg → default-property.9987f19670be82b6.jpg} +0 -0
  29. /package/dist/assets/images/{icon_close_2.png → icon_close_2.e41bb9a4db48e048.png} +0 -0
  30. /package/dist/assets/images/{icon_gallery.svg → icon_gallery.269b721daf2ca907.svg} +0 -0
  31. /package/dist/assets/images/{icon_map.svg → icon_map.2318ec664c3e615e.svg} +0 -0
  32. /package/dist/assets/images/{icon_share_1.svg → icon_share_1.b9ec05630dc1087e.svg} +0 -0
  33. /package/dist/assets/images/{layer_icon.svg → layer_icon.9b56c187199c44b5.svg} +0 -0
  34. /package/dist/assets/images/{locationIcon.svg → locationIcon.0af399c78e0cdc20.svg} +0 -0
  35. /package/dist/assets/images/{locationIconBlack.svg → locationIconBlack.eb8e9e9226b43573.svg} +0 -0
@@ -1,82 +1,83 @@
1
- import React, { useState } from "react";
2
- // import { FormattedMessage } from "react-intl";
3
- import ShareIcon from "../../assets/images/icon_share_1.svg";
4
- import locationIcon from "../../assets/images/locationIconBlack.svg";
5
- import PopUp from "../ImageListPopup/ImageListPopup";
6
- import "./PropertyDetailsHeader.css";
7
-
8
- export interface PopupProps {
9
- property: {
10
- city: string;
11
- constructedArea: string;
12
- rooms: string;
13
- propertyArea: string;
14
- askingPrice: string;
15
- };
16
- showPopUp: boolean;
17
- }
18
-
19
- export default function PropertyDetailsHeader(props: PopupProps) {
20
- const [showPopUp, setShowPopUp] = useState(false);
21
-
22
- const handlePopUp = () => {
23
- setShowPopUp(!showPopUp);
24
- };
25
-
26
- return (
27
- <div className="Pheader compact d-flex col-12 col-lg-12 position-relative mt-5 ">
28
- <div className="header_Text d-flex col-lg-7 col-md-9 mt-4 ms-4 ">
29
- <strong>
30
- Einziehen ohne einen Pinselstrich - Kernsaniertes Einfamilienhaus in
31
- top Lage
32
- </strong>
33
- </div>
34
- <div className="header_Text text-truncate col-lg-6 col-md-7 d-flex flex-row position-absolute ms-4">
35
- <img src={locationIcon} className="vector me-2" />
36
-
37
- <div className="propText text-truncate col-lg-6 col-md-6 d-flex align-items-center">
38
- {props.property.city}
39
- </div>
40
- </div>
41
- <div className="d-flex col-lg-5 col-md-6 col-sm-5 justify-content-end position-absolute end-0 mt-4">
42
- {/* <img src={Hearticon} alt="Location Icon" className="v_share me-3" /> */}
43
- <img src={ShareIcon} className="v_share me-3" onClick={handlePopUp} />
44
- </div>
45
- <div className="fetch_section d-flex align-items-center flex-row col-lg-5 col-md-6 col-sm-5 justify-content-end position-absolute end-0">
46
- {props && (
47
- <div className=" propText col-lg-3 col-md-3 h-100 d-flex align-items-center justify-content-center ">
48
- {props.property.askingPrice} <br />
49
- Kaufpreis
50
- </div>
51
- )}
52
- {props && (
53
- <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center">
54
- {props.property.constructedArea} <br />
55
- constructedArea
56
- {/* <FormattedMessage id="LIVING_SPACE" /> */}
57
- </div>
58
- )}
59
- {props && (
60
- <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center">
61
- {props.property.rooms} <br />
62
- rooms
63
- {/* <FormattedMessage id="ROOMS" /> */}
64
- </div>
65
- )}
66
- {props && (
67
- <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center">
68
- {props.property.propertyArea}
69
- <br />
70
- Grundstück
71
- {/* <FormattedMessage id="Grundstück" /> */}
72
- </div>
73
- )}
74
- </div>
75
- {/* {showPopUp && (
76
- <PopUp
77
-
78
- />
79
- )} */}
80
- </div>
81
- );
82
- }
1
+ import React, { useState } from "react";
2
+ // import { FormattedMessage } from "react-intl";
3
+ import ShareIcon from "../../assets/images/icon_share_1.svg";
4
+ import locationIcon from "../../assets/images/locationIconBlack.svg";
5
+ import "./PropertyDetailsHeader.css";
6
+
7
+ export interface PopupProps {
8
+ property: {
9
+ city: string;
10
+ constructedArea: string;
11
+ rooms: string;
12
+ propertyArea: string;
13
+ askingPrice: string;
14
+ };
15
+ title: string;
16
+ }
17
+
18
+ export default function PropertyDetailsHeader(props: PopupProps) {
19
+ const [showPopUp, setShowPopUp] = useState(false);
20
+
21
+ const handlePopUp = () => {
22
+ setShowPopUp(!showPopUp);
23
+ };
24
+
25
+ return (
26
+ <div className="Pheader compact d-flex col-12 col-lg-12 position-relative mt-5 ">
27
+ <div className="header_Text d-flex col-lg-7 col-md-9 mt-4 ms-4 ">
28
+ <strong>{props.title ?? "-"}</strong>
29
+ </div>
30
+ <div className="header_Text text-truncate col-lg-6 col-md-7 d-flex flex-row position-absolute ms-4">
31
+ <img src={locationIcon} className="vector me-2" alt="location Icon" />
32
+
33
+ <div className="propText text-truncate col-lg-6 col-md-6 d-flex align-items-center">
34
+ {props.property.city}
35
+ </div>
36
+ </div>
37
+ <div className="d-flex col-lg-5 col-md-6 col-sm-5 justify-content-end position-absolute end-0 mt-4">
38
+ {/* <img src={Hearticon} alt="Location Icon" className="v_share me-3" /> */}
39
+ <img
40
+ src={ShareIcon}
41
+ alt="share icon"
42
+ className="v_share me-3"
43
+ onClick={handlePopUp}
44
+ />
45
+ </div>
46
+ <div className="fetch_section d-flex align-items-center flex-row col-lg-5 col-md-6 col-sm-5 justify-content-end position-absolute end-0">
47
+ {props && (
48
+ <div className=" propText col-lg-3 col-md-3 h-100 d-flex align-items-center justify-content-center ">
49
+ {props.property.askingPrice} <br />
50
+ Kaufpreis
51
+ </div>
52
+ )}
53
+ {props && (
54
+ <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center">
55
+ {props.property.constructedArea} m² <br />
56
+ Wohnfläche
57
+ {/* <FormattedMessage id="LIVING_SPACE" /> */}
58
+ </div>
59
+ )}
60
+ {props && (
61
+ <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center">
62
+ {props.property.rooms} <br />
63
+ Zimmer
64
+ {/* <FormattedMessage id="ROOMS" /> */}
65
+ </div>
66
+ )}
67
+ {props && (
68
+ <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center">
69
+ {props.property.propertyArea}
70
+ <br />
71
+ Grundstück
72
+ {/* <FormattedMessage id="Grundstück" /> */}
73
+ </div>
74
+ )}
75
+ </div>
76
+ {/* {showPopUp && (
77
+ <PopUp
78
+
79
+ />
80
+ )} */}
81
+ </div>
82
+ );
83
+ }
@@ -1,5 +1,4 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- // import { useParams } from "react-router-dom";
1
+ import React, { useRef, useState } from "react";
3
2
  import iconArrowRight from "../../assets/Images/Icon_rightArrow.svg";
4
3
  import blcIconArrowRight from "../../assets/Images/blackarrow-Right.svg";
5
4
  import blcIconArrowLeft from "../../assets/Images/blckarrow-Left.svg";
@@ -12,36 +11,15 @@ import ImageListPopup from "../ImageListPopup/ImageListPopup";
12
11
  import PopupProps from "../ImageListPopup/ImageListPopup";
13
12
 
14
13
  interface PopupProps {
15
- property: {
16
- city: string;
17
- constructedArea: string;
18
- rooms: string;
19
- propertyArea: string;
20
- askingPrice: string;
21
- };
22
- pictureUrls: any[];
23
- imageListRef: any;
14
+ pictureUrls: { title: string; url: string }[];
24
15
  }
25
16
  export default function PropertyImageList(prop: PopupProps) {
26
- const [mainImage, setMainImage] = useState(null);
27
17
  const [currentImageIndex, setCurrentImageIndex] = useState(0);
28
18
  const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
29
- const imageListRef = useRef(null);
30
- const [open, setopen] = useState<boolean>(false);
31
- // const [pictureUrls, setPictureUrls] = useState([]);
32
-
33
- // const baseUrl = "https://api-dev.nestiq.de";
34
- // const pictureUrls = prop.property.pictures.map(
35
- // (picture) => `${baseUrl}${picture.contentUrl}`
36
- // );
37
- useEffect(() => {
38
- if (prop.pictureUrls.length > 0) {
39
- setMainImage(prop.pictureUrls[0]);
40
- }
41
- }, [prop.pictureUrls]);
19
+ const imageListRef = useRef<HTMLDivElement | null>(null);
42
20
 
43
21
  const handleArrowClickInMainImage = (direction: any) => {
44
- if (!prop.property || prop.pictureUrls.length === 0) return;
22
+ if (prop.pictureUrls.length === 0) return;
45
23
 
46
24
  let newIndex = currentImageIndex;
47
25
  if (direction === "left") {
@@ -53,9 +31,11 @@ export default function PropertyImageList(prop: PopupProps) {
53
31
  }
54
32
 
55
33
  setCurrentImageIndex(newIndex);
56
- setMainImage(prop.pictureUrls[newIndex]);
57
34
 
58
-
35
+ imageListRef.current!.scrollTo({
36
+ left: newIndex * 150,
37
+ behavior: "smooth",
38
+ });
59
39
  };
60
40
 
61
41
  const toggleAllPhotos = () => {
@@ -67,7 +47,7 @@ export default function PropertyImageList(prop: PopupProps) {
67
47
  <div
68
48
  className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
69
49
  style={{
70
- backgroundImage: `url(${prop.pictureUrls[currentImageIndex]})`,
50
+ backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
71
51
  backgroundSize: "cover",
72
52
  backgroundPosition: "center",
73
53
  }}
@@ -114,16 +94,15 @@ export default function PropertyImageList(prop: PopupProps) {
114
94
  className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
115
95
  ref={imageListRef}
116
96
  >
117
- {prop.property && (
97
+ {prop.pictureUrls.length > 0 && (
118
98
  <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
119
- {prop.pictureUrls.map((imageUrl, index) => (
99
+ {prop.pictureUrls.map((picture, index) => (
120
100
  <div
121
101
  key={index}
122
102
  className="col-lg-12 h-100 d-flex"
123
103
  onClick={() => {
124
- setMainImage(imageUrl);
125
104
  setCurrentImageIndex(index);
126
- prop.imageListRef.current.scrollTo({
105
+ imageListRef.current!.scrollTo({
127
106
  left: index * 150,
128
107
  behavior: "smooth",
129
108
  });
@@ -131,7 +110,7 @@ export default function PropertyImageList(prop: PopupProps) {
131
110
  role="button"
132
111
  >
133
112
  <img
134
- src={imageUrl}
113
+ src={picture.url}
135
114
  alt={`Image ${index + 1}`}
136
115
  className="col-12 h-100 rounded-3 object-fit-cover"
137
116
  />
@@ -188,15 +167,7 @@ export default function PropertyImageList(prop: PopupProps) {
188
167
  </div>
189
168
 
190
169
  {/* Popup for all photos */}
191
- {isImagePopupOpen && (
192
- <ImageListPopup
193
- currentImageIndex={currentImageIndex}
194
- handleArrowClickInMainImage={handleArrowClickInMainImage}
195
- imageListRef={imageListRef}
196
- pictureUrls={prop.pictureUrls}
197
- property={prop.property}
198
- />
199
- )}
170
+ {isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
200
171
  </div>
201
172
  );
202
173
  }
package/tsconfig.json CHANGED
@@ -11,6 +11,8 @@
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "moduleResolution": "node",
13
13
  "resolveJsonModule": true,
14
+ "allowSyntheticDefaultImports": true,
15
+ "sourceMap": true,
14
16
  "baseUrl": ".",
15
17
  "paths": {
16
18
  "*": ["node_modules/*", "src/types/*"]
@@ -1,3 +0,0 @@
1
- <svg width="30" height="27" viewBox="0 0 30 27" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M27.24 2.467a7.97 7.97 0 0 0-11.275.004l-.966.978-.958-.976-.006-.006a7.97 7.97 0 0 0-11.27 0l-.43.43a7.97 7.97 0 0 0 0 11.27l11.354 11.356 1.282 1.343.03-.03.034.033 1.201-1.268L27.67 14.168a7.979 7.979 0 0 0 0-11.27l-.43-.431zm-.98 10.292L15.003 24.018l-11.26-11.26a5.977 5.977 0 0 1 0-8.452l.431-.43a5.977 5.977 0 0 1 8.45-.003l2.372 2.415 2.383-2.412a5.977 5.977 0 0 1 8.453 0l.43.43a5.984 5.984 0 0 1 0 8.453z" fill="#fff"/>
3
- </svg>
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- var Button = function (_a) {
3
- var label = _a.label;
4
- return React.createElement("button", null, label);
5
- };
6
- export default Button;
@@ -1,26 +0,0 @@
1
- import React, { useState } from "react";
2
- import "bootstrap/dist/css/bootstrap.min.css";
3
- import "./ImageListPopup.css";
4
- var ImageListPopup = function (_a) {
5
- var images = _a.images, onClose = _a.onClose;
6
- var _b = useState(0), currentIndex = _b[0], setCurrentIndex = _b[1];
7
- var handlePrevious = function () {
8
- setCurrentIndex(function (prevIndex) { return (prevIndex > 0 ? prevIndex - 1 : prevIndex); });
9
- };
10
- var handleNext = function () {
11
- setCurrentIndex(function (prevIndex) {
12
- return prevIndex < images.length - 1 ? prevIndex + 1 : prevIndex;
13
- });
14
- };
15
- return (React.createElement("div", { className: "popup-overlay" },
16
- React.createElement("div", { className: "popup-container" },
17
- React.createElement("div", { className: "popup-header" },
18
- React.createElement("span", null, images[currentIndex].title),
19
- React.createElement("button", { className: "btn-close", onClick: onClose })),
20
- React.createElement("div", { className: "popup-body" },
21
- React.createElement("img", { src: images[currentIndex].src, alt: images[currentIndex].title, className: "img-fluid" })),
22
- React.createElement("div", { className: "popup-footer" }, images.length > 1 && (React.createElement(React.Fragment, null,
23
- React.createElement("button", { className: "btn btn-secondary me-2", onClick: handlePrevious }, "Previous"),
24
- React.createElement("button", { className: "btn btn-secondary", onClick: handleNext }, "Next")))))));
25
- };
26
- export default ImageListPopup;
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import closeIcon from "src/assets/images/icon_close 2.png";
3
- import "./Popup.css";
4
- var Popup = function (_a) {
5
- var onCloseClick = _a.onCloseClick, children = _a.children;
6
- return (React.createElement("div", { className: "popup-overlay" },
7
- React.createElement("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" },
8
- React.createElement("div", { className: "end-0 top-0 position-absolute " },
9
- React.createElement("img", { src: closeIcon, alt: "close", className: "closeIcon me-2", onClick: onCloseClick })),
10
- children)));
11
- };
12
- export default Popup;
Binary file