nestiq-component-library 1.0.24 → 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.
- package/dist/components/ImageListPopup/ImageListPopup.d.ts +4 -11
- package/dist/components/PropertyDetailsHeader/PropertyDetailsHeader.d.ts +1 -1
- package/dist/components/PropertyImageList/PropertyImageList.d.ts +4 -11
- package/dist/index.es.js +40 -71
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +39 -70
- package/dist/index.js.map +1 -1
- package/package.json +3 -7
- package/rollup.config.mjs +35 -40
- package/src/components/ImageListPopup/ImageListPopup.css +107 -107
- package/src/components/ImageListPopup/ImageListPopup.tsx +141 -212
- package/src/components/Popup/Popup.tsx +28 -28
- package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +83 -82
- package/src/components/PropertyImageList/PropertyImageList.tsx +11 -46
- package/tsconfig.json +2 -0
- package/dist/assets/images/heartIcon.svg +0 -3
- package/dist/assets/images/icon-close-white.webp +0 -0
- package/dist/assets/images/no-image-icon.png +0 -0
- package/dist/components/Button/Button.js +0 -6
- package/dist/components/ImageListPopup/ImageListPopup.js +0 -26
- package/dist/components/Popup/Popup.js +0 -12
- package/nestiq-component-library-1.0.22.tgz +0 -0
- /package/dist/assets/images/{Icon_rightArrow.svg → Icon_rightArrow.bced4a705c07148d.svg} +0 -0
- /package/dist/assets/images/{LayersIcon.svg → LayersIcon.34c085c352a2c9c8.svg} +0 -0
- /package/dist/assets/images/{blackarrow-Right.svg → blackarrow-Right.e585ae62dd55abae.svg} +0 -0
- /package/dist/assets/images/{blckarrow-Left.svg → blckarrow-Left.e2134741aa368d30.svg} +0 -0
- /package/dist/assets/images/{chevron-left.svg → chevron-left.04f0a7f16b745c1a.svg} +0 -0
- /package/dist/assets/images/{default-property.jpg → default-property.9987f19670be82b6.jpg} +0 -0
- /package/dist/assets/images/{icon_close_2.png → icon_close_2.e41bb9a4db48e048.png} +0 -0
- /package/dist/assets/images/{icon_gallery.svg → icon_gallery.269b721daf2ca907.svg} +0 -0
- /package/dist/assets/images/{icon_map.svg → icon_map.2318ec664c3e615e.svg} +0 -0
- /package/dist/assets/images/{icon_share_1.svg → icon_share_1.b9ec05630dc1087e.svg} +0 -0
- /package/dist/assets/images/{layer_icon.svg → layer_icon.9b56c187199c44b5.svg} +0 -0
- /package/dist/assets/images/{locationIcon.svg → locationIcon.0af399c78e0cdc20.svg} +0 -0
- /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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
constructedArea
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
rooms
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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} m²
|
|
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, {
|
|
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,39 +11,15 @@ import ImageListPopup from "../ImageListPopup/ImageListPopup";
|
|
|
12
11
|
import PopupProps from "../ImageListPopup/ImageListPopup";
|
|
13
12
|
|
|
14
13
|
interface PopupProps {
|
|
15
|
-
|
|
16
|
-
city: string;
|
|
17
|
-
constructedArea: string;
|
|
18
|
-
rooms: string;
|
|
19
|
-
propertyArea: string;
|
|
20
|
-
askingPrice: string;
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
pictureUrls: any[];
|
|
24
|
-
currentImageIndex: number;
|
|
25
|
-
imageListRef: any;
|
|
26
|
-
isImagePopupOpen: boolean;
|
|
14
|
+
pictureUrls: { title: string; url: string }[];
|
|
27
15
|
}
|
|
28
16
|
export default function PropertyImageList(prop: PopupProps) {
|
|
29
|
-
const [mainImage, setMainImage] = useState(null);
|
|
30
17
|
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
31
18
|
const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
|
|
32
|
-
const imageListRef = useRef(null);
|
|
33
|
-
const [open, setopen] = useState<boolean>(false);
|
|
34
|
-
// const [pictureUrls, setPictureUrls] = useState([]);
|
|
35
|
-
|
|
36
|
-
// const baseUrl = "https://api-dev.nestiq.de";
|
|
37
|
-
// const pictureUrls = prop.property.pictures.map(
|
|
38
|
-
// (picture) => `${baseUrl}${picture.contentUrl}`
|
|
39
|
-
// );
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
if (prop.pictureUrls.length > 0) {
|
|
42
|
-
setMainImage(prop.pictureUrls[0]);
|
|
43
|
-
}
|
|
44
|
-
}, [prop.pictureUrls]);
|
|
19
|
+
const imageListRef = useRef<HTMLDivElement | null>(null);
|
|
45
20
|
|
|
46
21
|
const handleArrowClickInMainImage = (direction: any) => {
|
|
47
|
-
if (
|
|
22
|
+
if (prop.pictureUrls.length === 0) return;
|
|
48
23
|
|
|
49
24
|
let newIndex = currentImageIndex;
|
|
50
25
|
if (direction === "left") {
|
|
@@ -56,9 +31,8 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
56
31
|
}
|
|
57
32
|
|
|
58
33
|
setCurrentImageIndex(newIndex);
|
|
59
|
-
setMainImage(prop.pictureUrls[newIndex]);
|
|
60
34
|
|
|
61
|
-
|
|
35
|
+
imageListRef.current!.scrollTo({
|
|
62
36
|
left: newIndex * 150,
|
|
63
37
|
behavior: "smooth",
|
|
64
38
|
});
|
|
@@ -73,7 +47,7 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
73
47
|
<div
|
|
74
48
|
className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
|
|
75
49
|
style={{
|
|
76
|
-
backgroundImage: `url(${prop.pictureUrls[currentImageIndex]})`,
|
|
50
|
+
backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
|
|
77
51
|
backgroundSize: "cover",
|
|
78
52
|
backgroundPosition: "center",
|
|
79
53
|
}}
|
|
@@ -120,16 +94,15 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
120
94
|
className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
|
|
121
95
|
ref={imageListRef}
|
|
122
96
|
>
|
|
123
|
-
{prop.
|
|
97
|
+
{prop.pictureUrls.length > 0 && (
|
|
124
98
|
<div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
|
|
125
|
-
{prop.pictureUrls.map((
|
|
99
|
+
{prop.pictureUrls.map((picture, index) => (
|
|
126
100
|
<div
|
|
127
101
|
key={index}
|
|
128
102
|
className="col-lg-12 h-100 d-flex"
|
|
129
103
|
onClick={() => {
|
|
130
|
-
setMainImage(imageUrl);
|
|
131
104
|
setCurrentImageIndex(index);
|
|
132
|
-
|
|
105
|
+
imageListRef.current!.scrollTo({
|
|
133
106
|
left: index * 150,
|
|
134
107
|
behavior: "smooth",
|
|
135
108
|
});
|
|
@@ -137,7 +110,7 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
137
110
|
role="button"
|
|
138
111
|
>
|
|
139
112
|
<img
|
|
140
|
-
src={
|
|
113
|
+
src={picture.url}
|
|
141
114
|
alt={`Image ${index + 1}`}
|
|
142
115
|
className="col-12 h-100 rounded-3 object-fit-cover"
|
|
143
116
|
/>
|
|
@@ -194,15 +167,7 @@ export default function PropertyImageList(prop: PopupProps) {
|
|
|
194
167
|
</div>
|
|
195
168
|
|
|
196
169
|
{/* Popup for all photos */}
|
|
197
|
-
{isImagePopupOpen &&
|
|
198
|
-
<ImageListPopup
|
|
199
|
-
currentImageIndex={currentImageIndex}
|
|
200
|
-
handleArrowClickInMainImage={handleArrowClickInMainImage}
|
|
201
|
-
imageListRef={imageListRef}
|
|
202
|
-
pictureUrls={prop.pictureUrls}
|
|
203
|
-
property={prop.property}
|
|
204
|
-
/>
|
|
205
|
-
)}
|
|
170
|
+
{isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
|
|
206
171
|
</div>
|
|
207
172
|
);
|
|
208
173
|
}
|
package/tsconfig.json
CHANGED
|
@@ -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>
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/images/{locationIconBlack.svg → locationIconBlack.eb8e9e9226b43573.svg}
RENAMED
|
File without changes
|