nestiq-component-library 1.1.58 → 1.1.60
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/assets/images/Icon_rightArrow.svg +3 -0
- package/dist/assets/images/LayersIcon.svg +5 -0
- package/dist/assets/images/blackarrow-Right.svg +3 -0
- package/dist/assets/images/blckarrow-Left.svg +3 -0
- package/dist/assets/images/{card-arrow-left.55343410142dad3f.svg → card-arrow-left.28090aba4b4f2006.svg} +4 -4
- package/dist/assets/images/{card-arrow-right.60b3bf0e34c1800d.svg → card-arrow-right.c60af4cbbd49f3aa.svg} +4 -4
- package/dist/assets/images/chevron-left.svg +3 -0
- package/dist/assets/images/default-property.jpg +0 -0
- package/dist/assets/images/heartIcon.svg +3 -0
- package/dist/assets/images/icon-close-white.webp +0 -0
- package/dist/assets/images/icon_checkmark.9b48c4a4bc651b08.svg +10 -0
- package/dist/assets/images/icon_close 2.e41bb9a4db48e048.png +0 -0
- package/dist/assets/images/icon_close_2.png +0 -0
- package/dist/assets/images/icon_gallery.svg +4 -0
- package/dist/assets/images/icon_map.svg +10 -0
- package/dist/assets/images/icon_share_1.svg +3 -0
- package/dist/assets/images/layer_icon.svg +5 -0
- package/dist/assets/images/locationIcon.0af399c78e0cdc20.svg +4 -0
- package/dist/assets/images/locationIcon.svg +4 -0
- package/dist/assets/images/locationIconBlack.svg +4 -0
- package/dist/assets/images/{more.ce14789c8d37e327.svg → more.1e158adc48fbb406.svg} +12 -12
- package/dist/assets/images/no-image-icon.png +0 -0
- package/dist/assets/images/warning.6f99cb4c6a048b47.svg +11 -0
- package/dist/components/Button/Button.js +6 -0
- package/dist/components/ImageListPopup/ImageListPopup.js +26 -0
- package/dist/components/NewPropertyCard/NewPropertyCard.d.ts +1 -0
- package/dist/components/Popup/Popup.js +12 -0
- package/dist/components/SharePopup/PopUp.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +131 -101
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +131 -100
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +36 -36
- package/src/assets/images/card-arrow-left.svg +4 -4
- package/src/assets/images/card-arrow-right.svg +4 -4
- package/src/assets/images/more.svg +12 -12
- package/src/components/FloorPlanPopup/FloorPlanPopup.css +3 -3
- package/src/components/FloorPlanPopup/FloorPlanPopup.tsx +83 -83
- package/src/components/ImageListPopup/ImageListPopup.css +83 -83
- package/src/components/ImageListPopup/ImageListPopup.tsx +141 -141
- package/src/components/MessagePopup/MessagePopUp.tsx +156 -156
- package/src/components/NewPropertyCard/NewPropertyCard.tsx +285 -283
- package/src/components/Popup/Popup.tsx +29 -29
- package/src/components/ToastWrapper/ToastWrapper.tsx +25 -25
- package/src/index.tsx +1 -1
- package/src/models/message.model.ts +7 -7
- package/nestiq-component-library-1.1.58.tgz +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<svg width="4" height="20" viewBox="0 0 4 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#fxcoqj8dma)" fill="#313131">
|
|
3
|
-
<circle cx="2" cy="2" r="2"/>
|
|
4
|
-
<circle cx="2" cy="10" r="2"/>
|
|
5
|
-
<circle cx="2" cy="18" r="2"/>
|
|
6
|
-
</g>
|
|
7
|
-
<defs>
|
|
8
|
-
<clipPath id="fxcoqj8dma">
|
|
9
|
-
<path fill="#fff" d="M0 0h4v20H0z"/>
|
|
10
|
-
</clipPath>
|
|
11
|
-
</defs>
|
|
12
|
-
</svg>
|
|
1
|
+
<svg width="4" height="20" viewBox="0 0 4 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#fxcoqj8dma)" fill="#313131">
|
|
3
|
+
<circle cx="2" cy="2" r="2"/>
|
|
4
|
+
<circle cx="2" cy="10" r="2"/>
|
|
5
|
+
<circle cx="2" cy="18" r="2"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="fxcoqj8dma">
|
|
9
|
+
<path fill="#fff" d="M0 0h4v20H0z"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.mainImage {
|
|
2
|
-
height: 80%;
|
|
3
|
-
}
|
|
1
|
+
.mainImage {
|
|
2
|
+
height: 80%;
|
|
3
|
+
}
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import iconClose from "../../assets/images/close.png";
|
|
3
|
-
|
|
4
|
-
interface PopupProps {
|
|
5
|
-
contentUrl: string;
|
|
6
|
-
onCloseClick: () => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const FloorPlanPopup: React.FC<PopupProps> = ({ contentUrl, onCloseClick }) => {
|
|
10
|
-
const [isContentImage, setIsContentImage] = useState(false);
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (contentUrl) {
|
|
14
|
-
const fileFormat = contentUrl.split(".").pop();
|
|
15
|
-
if (
|
|
16
|
-
fileFormat === "png" ||
|
|
17
|
-
fileFormat === "jpg" ||
|
|
18
|
-
fileFormat === "jpeg" ||
|
|
19
|
-
fileFormat === "svg"
|
|
20
|
-
) {
|
|
21
|
-
setIsContentImage(true);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}, [contentUrl]);
|
|
25
|
-
|
|
26
|
-
const downloadButtonClickHandler = (): void => {
|
|
27
|
-
// Create a temporary anchor element
|
|
28
|
-
const link = document.createElement("a");
|
|
29
|
-
link.href = contentUrl;
|
|
30
|
-
link.setAttribute("download", ""); // This attribute hints the browser to download the file
|
|
31
|
-
|
|
32
|
-
// Append the anchor to the body and click it to trigger the download
|
|
33
|
-
document.body.appendChild(link);
|
|
34
|
-
link.click();
|
|
35
|
-
|
|
36
|
-
// Clean up: remove the anchor element
|
|
37
|
-
document.body.removeChild(link);
|
|
38
|
-
};
|
|
39
|
-
return (
|
|
40
|
-
<div className="popup-overlay">
|
|
41
|
-
<div className=" d-flex w-50 flex-column col-6 ">
|
|
42
|
-
<div className="d-flex align-self-end me-5 mt-5">
|
|
43
|
-
<img
|
|
44
|
-
src={iconClose}
|
|
45
|
-
alt="close"
|
|
46
|
-
className="closeIcon mt-5"
|
|
47
|
-
onClick={onCloseClick}
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
<div className="d-flex justify-content-center">
|
|
51
|
-
<div className="p-2 bd-highlight">
|
|
52
|
-
{isContentImage && (
|
|
53
|
-
<div
|
|
54
|
-
className="rounded-5 mainImage"
|
|
55
|
-
style={{
|
|
56
|
-
backgroundImage: `url(${contentUrl})`,
|
|
57
|
-
height: "350px",
|
|
58
|
-
width: "600px",
|
|
59
|
-
backgroundSize: "cover",
|
|
60
|
-
backgroundPosition: "center",
|
|
61
|
-
}}
|
|
62
|
-
></div>
|
|
63
|
-
)}
|
|
64
|
-
{!isContentImage && (
|
|
65
|
-
<div className="text-white text-center">
|
|
66
|
-
No Preview Available
|
|
67
|
-
<button
|
|
68
|
-
className="btn btn-info"
|
|
69
|
-
onClick={downloadButtonClickHandler}
|
|
70
|
-
>
|
|
71
|
-
{" "}
|
|
72
|
-
Download{" "}
|
|
73
|
-
</button>
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export default FloorPlanPopup;
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import iconClose from "../../assets/images/close.png";
|
|
3
|
+
|
|
4
|
+
interface PopupProps {
|
|
5
|
+
contentUrl: string;
|
|
6
|
+
onCloseClick: () => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const FloorPlanPopup: React.FC<PopupProps> = ({ contentUrl, onCloseClick }) => {
|
|
10
|
+
const [isContentImage, setIsContentImage] = useState(false);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (contentUrl) {
|
|
14
|
+
const fileFormat = contentUrl.split(".").pop();
|
|
15
|
+
if (
|
|
16
|
+
fileFormat === "png" ||
|
|
17
|
+
fileFormat === "jpg" ||
|
|
18
|
+
fileFormat === "jpeg" ||
|
|
19
|
+
fileFormat === "svg"
|
|
20
|
+
) {
|
|
21
|
+
setIsContentImage(true);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, [contentUrl]);
|
|
25
|
+
|
|
26
|
+
const downloadButtonClickHandler = (): void => {
|
|
27
|
+
// Create a temporary anchor element
|
|
28
|
+
const link = document.createElement("a");
|
|
29
|
+
link.href = contentUrl;
|
|
30
|
+
link.setAttribute("download", ""); // This attribute hints the browser to download the file
|
|
31
|
+
|
|
32
|
+
// Append the anchor to the body and click it to trigger the download
|
|
33
|
+
document.body.appendChild(link);
|
|
34
|
+
link.click();
|
|
35
|
+
|
|
36
|
+
// Clean up: remove the anchor element
|
|
37
|
+
document.body.removeChild(link);
|
|
38
|
+
};
|
|
39
|
+
return (
|
|
40
|
+
<div className="popup-overlay">
|
|
41
|
+
<div className=" d-flex w-50 flex-column col-6 ">
|
|
42
|
+
<div className="d-flex align-self-end me-5 mt-5">
|
|
43
|
+
<img
|
|
44
|
+
src={iconClose}
|
|
45
|
+
alt="close"
|
|
46
|
+
className="closeIcon mt-5"
|
|
47
|
+
onClick={onCloseClick}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
<div className="d-flex justify-content-center">
|
|
51
|
+
<div className="p-2 bd-highlight">
|
|
52
|
+
{isContentImage && (
|
|
53
|
+
<div
|
|
54
|
+
className="rounded-5 mainImage"
|
|
55
|
+
style={{
|
|
56
|
+
backgroundImage: `url(${contentUrl})`,
|
|
57
|
+
height: "350px",
|
|
58
|
+
width: "600px",
|
|
59
|
+
backgroundSize: "cover",
|
|
60
|
+
backgroundPosition: "center",
|
|
61
|
+
}}
|
|
62
|
+
></div>
|
|
63
|
+
)}
|
|
64
|
+
{!isContentImage && (
|
|
65
|
+
<div className="text-white text-center">
|
|
66
|
+
No Preview Available
|
|
67
|
+
<button
|
|
68
|
+
className="btn btn-info"
|
|
69
|
+
onClick={downloadButtonClickHandler}
|
|
70
|
+
>
|
|
71
|
+
{" "}
|
|
72
|
+
Download{" "}
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default FloorPlanPopup;
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
.popup-header {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
width: 100%;
|
|
6
|
-
padding: 1rem;
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.popup-title {
|
|
12
|
-
color: white;
|
|
13
|
-
font-size: 24px;
|
|
14
|
-
font-weight: bold;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.btn-close {
|
|
18
|
-
position: absolute;
|
|
19
|
-
right: 1rem;
|
|
20
|
-
top: 1rem;
|
|
21
|
-
background: none;
|
|
22
|
-
border: none;
|
|
23
|
-
color: white;
|
|
24
|
-
font-size: 24px;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.popup-body {
|
|
29
|
-
display: flex;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
align-items: center;
|
|
32
|
-
padding: 1rem;
|
|
33
|
-
position: relative;
|
|
34
|
-
flex: 1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.main-image {
|
|
38
|
-
max-width: 100%;
|
|
39
|
-
max-height: 80vh;
|
|
40
|
-
border-radius: 8px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.btn-prev,
|
|
44
|
-
.btn-next {
|
|
45
|
-
background: none;
|
|
46
|
-
border: none;
|
|
47
|
-
color: white;
|
|
48
|
-
font-size: 48px;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: 50%;
|
|
52
|
-
transform: translateY(-50%);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.btn-prev {
|
|
56
|
-
left: 10px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.btn-next {
|
|
60
|
-
right: 10px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.popup-thumbnails {
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
align-items: center;
|
|
67
|
-
gap: 10px;
|
|
68
|
-
padding: 1rem;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.thumbnail {
|
|
72
|
-
width: 60px;
|
|
73
|
-
height: 60px;
|
|
74
|
-
object-fit: cover;
|
|
75
|
-
border-radius: 8px;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
opacity: 0.6;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.thumbnail.active {
|
|
81
|
-
border: 2px solid white;
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}
|
|
1
|
+
.popup-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 1rem;
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.popup-title {
|
|
12
|
+
color: white;
|
|
13
|
+
font-size: 24px;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.btn-close {
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 1rem;
|
|
20
|
+
top: 1rem;
|
|
21
|
+
background: none;
|
|
22
|
+
border: none;
|
|
23
|
+
color: white;
|
|
24
|
+
font-size: 24px;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.popup-body {
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 1rem;
|
|
33
|
+
position: relative;
|
|
34
|
+
flex: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.main-image {
|
|
38
|
+
max-width: 100%;
|
|
39
|
+
max-height: 80vh;
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.btn-prev,
|
|
44
|
+
.btn-next {
|
|
45
|
+
background: none;
|
|
46
|
+
border: none;
|
|
47
|
+
color: white;
|
|
48
|
+
font-size: 48px;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 50%;
|
|
52
|
+
transform: translateY(-50%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.btn-prev {
|
|
56
|
+
left: 10px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.btn-next {
|
|
60
|
+
right: 10px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.popup-thumbnails {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 10px;
|
|
68
|
+
padding: 1rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.thumbnail {
|
|
72
|
+
width: 60px;
|
|
73
|
+
height: 60px;
|
|
74
|
+
object-fit: cover;
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
opacity: 0.6;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.thumbnail.active {
|
|
81
|
+
border: 2px solid white;
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
import "./ImageListPopup.css";
|
|
2
|
-
import React, { useRef, useState } from "react";
|
|
3
|
-
import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
|
|
4
|
-
import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
|
|
5
|
-
import iconClose from "../../assets/images/close.png";
|
|
6
|
-
import "../../styles/common.css";
|
|
7
|
-
|
|
8
|
-
interface PopupProps {
|
|
9
|
-
pictureUrls: { title: string; url: string }[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function ImageListPopup(props: PopupProps) {
|
|
13
|
-
const [showPopUp, setShowPopUp] = useState(true);
|
|
14
|
-
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
15
|
-
const imageListRef = useRef<HTMLDivElement | null>(null);
|
|
16
|
-
|
|
17
|
-
const handleArrowClickInMainImage = (direction: any) => {
|
|
18
|
-
if (props.pictureUrls.length === 0) return;
|
|
19
|
-
|
|
20
|
-
let newIndex = currentImageIndex;
|
|
21
|
-
if (direction === "left") {
|
|
22
|
-
newIndex =
|
|
23
|
-
(currentImageIndex - 1 + props.pictureUrls.length) %
|
|
24
|
-
props.pictureUrls.length;
|
|
25
|
-
} else if (direction === "right") {
|
|
26
|
-
newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
setCurrentImageIndex(newIndex);
|
|
30
|
-
|
|
31
|
-
imageListRef.current!.scrollTo({
|
|
32
|
-
left: newIndex * 150,
|
|
33
|
-
behavior: "smooth",
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const handleClose = () => {
|
|
38
|
-
setShowPopUp(false);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div>
|
|
43
|
-
{showPopUp && (
|
|
44
|
-
<div className="popup-overlay">
|
|
45
|
-
<div className=" d-flex w-50 flex-column col-6 ">
|
|
46
|
-
<div className="d-flex align-self-end me-5 mt-5">
|
|
47
|
-
<img
|
|
48
|
-
src={iconClose}
|
|
49
|
-
alt="close"
|
|
50
|
-
className="closeIcon mt-5"
|
|
51
|
-
onClick={handleClose}
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
<span className="text-white align-self-center">
|
|
55
|
-
{props.pictureUrls[currentImageIndex].title}
|
|
56
|
-
</span>
|
|
57
|
-
<div className="d-flex justify-content-center">
|
|
58
|
-
<div className="p-2 bd-highlight align-self-center align-items-center me-5">
|
|
59
|
-
<div
|
|
60
|
-
className="rounded-circle border onImageArrow start-0 d-flex "
|
|
61
|
-
role="button"
|
|
62
|
-
onClick={() => handleArrowClickInMainImage("left")}
|
|
63
|
-
>
|
|
64
|
-
<img
|
|
65
|
-
src={blcIconArrowLeft}
|
|
66
|
-
className="blackArrow align-self-center"
|
|
67
|
-
alt="Left Arrow"
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
<div className="p-2 bd-highlight">
|
|
72
|
-
<div
|
|
73
|
-
className=" rounded-5 mainImage "
|
|
74
|
-
style={{
|
|
75
|
-
backgroundImage: `url(${props.pictureUrls[currentImageIndex].url})`,
|
|
76
|
-
height: "350px",
|
|
77
|
-
width: "600px",
|
|
78
|
-
backgroundSize: "cover",
|
|
79
|
-
backgroundPosition: "center",
|
|
80
|
-
}}
|
|
81
|
-
></div>
|
|
82
|
-
</div>
|
|
83
|
-
<div className="p-2 bd-highlight align-self-center ms-5">
|
|
84
|
-
{" "}
|
|
85
|
-
<div
|
|
86
|
-
role="button"
|
|
87
|
-
className="rounded-circle border onImageArrow d-flex justify-content-center"
|
|
88
|
-
onClick={() => handleArrowClickInMainImage("right")}
|
|
89
|
-
>
|
|
90
|
-
<img
|
|
91
|
-
src={blcIconArrowRight}
|
|
92
|
-
className="blackArrow align-self-center"
|
|
93
|
-
alt="Right Arrow"
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
<div className="d-flex flex-row">
|
|
99
|
-
{/* Arrows on the main image */}
|
|
100
|
-
</div>
|
|
101
|
-
<div className="d-flex flex-row gap-4 w-100 secondList ">
|
|
102
|
-
<div className="col-lg-12 d-flex flex-row p-1 align-self-center mt-5">
|
|
103
|
-
<div className="col-12 position-relative d-flex justify-content-center">
|
|
104
|
-
<div
|
|
105
|
-
className="col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto "
|
|
106
|
-
ref={imageListRef}
|
|
107
|
-
>
|
|
108
|
-
{props.pictureUrls.length > 0 && (
|
|
109
|
-
<div className="col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3">
|
|
110
|
-
{props.pictureUrls.map((picture, index) => (
|
|
111
|
-
<div
|
|
112
|
-
key={index}
|
|
113
|
-
className="col-lg-12 h-100 d-flex"
|
|
114
|
-
onClick={() => {
|
|
115
|
-
setCurrentImageIndex(index);
|
|
116
|
-
imageListRef.current!.scrollTo({
|
|
117
|
-
left: index * 150,
|
|
118
|
-
behavior: "smooth",
|
|
119
|
-
});
|
|
120
|
-
}}
|
|
121
|
-
role="button"
|
|
122
|
-
>
|
|
123
|
-
<img
|
|
124
|
-
src={picture.url}
|
|
125
|
-
alt={`Image ${index + 1}`}
|
|
126
|
-
className="col-12 h-100 rounded-3 object-fit-cover"
|
|
127
|
-
/>
|
|
128
|
-
</div>
|
|
129
|
-
))}
|
|
130
|
-
</div>
|
|
131
|
-
)}
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
)}
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
1
|
+
import "./ImageListPopup.css";
|
|
2
|
+
import React, { useRef, useState } from "react";
|
|
3
|
+
import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
|
|
4
|
+
import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
|
|
5
|
+
import iconClose from "../../assets/images/close.png";
|
|
6
|
+
import "../../styles/common.css";
|
|
7
|
+
|
|
8
|
+
interface PopupProps {
|
|
9
|
+
pictureUrls: { title: string; url: string }[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function ImageListPopup(props: PopupProps) {
|
|
13
|
+
const [showPopUp, setShowPopUp] = useState(true);
|
|
14
|
+
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
15
|
+
const imageListRef = useRef<HTMLDivElement | null>(null);
|
|
16
|
+
|
|
17
|
+
const handleArrowClickInMainImage = (direction: any) => {
|
|
18
|
+
if (props.pictureUrls.length === 0) return;
|
|
19
|
+
|
|
20
|
+
let newIndex = currentImageIndex;
|
|
21
|
+
if (direction === "left") {
|
|
22
|
+
newIndex =
|
|
23
|
+
(currentImageIndex - 1 + props.pictureUrls.length) %
|
|
24
|
+
props.pictureUrls.length;
|
|
25
|
+
} else if (direction === "right") {
|
|
26
|
+
newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
setCurrentImageIndex(newIndex);
|
|
30
|
+
|
|
31
|
+
imageListRef.current!.scrollTo({
|
|
32
|
+
left: newIndex * 150,
|
|
33
|
+
behavior: "smooth",
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleClose = () => {
|
|
38
|
+
setShowPopUp(false);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div>
|
|
43
|
+
{showPopUp && (
|
|
44
|
+
<div className="popup-overlay">
|
|
45
|
+
<div className=" d-flex w-50 flex-column col-6 ">
|
|
46
|
+
<div className="d-flex align-self-end me-5 mt-5">
|
|
47
|
+
<img
|
|
48
|
+
src={iconClose}
|
|
49
|
+
alt="close"
|
|
50
|
+
className="closeIcon mt-5"
|
|
51
|
+
onClick={handleClose}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
<span className="text-white align-self-center">
|
|
55
|
+
{props.pictureUrls[currentImageIndex].title}
|
|
56
|
+
</span>
|
|
57
|
+
<div className="d-flex justify-content-center">
|
|
58
|
+
<div className="p-2 bd-highlight align-self-center align-items-center me-5">
|
|
59
|
+
<div
|
|
60
|
+
className="rounded-circle border onImageArrow start-0 d-flex "
|
|
61
|
+
role="button"
|
|
62
|
+
onClick={() => handleArrowClickInMainImage("left")}
|
|
63
|
+
>
|
|
64
|
+
<img
|
|
65
|
+
src={blcIconArrowLeft}
|
|
66
|
+
className="blackArrow align-self-center"
|
|
67
|
+
alt="Left Arrow"
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div className="p-2 bd-highlight">
|
|
72
|
+
<div
|
|
73
|
+
className=" rounded-5 mainImage "
|
|
74
|
+
style={{
|
|
75
|
+
backgroundImage: `url(${props.pictureUrls[currentImageIndex].url})`,
|
|
76
|
+
height: "350px",
|
|
77
|
+
width: "600px",
|
|
78
|
+
backgroundSize: "cover",
|
|
79
|
+
backgroundPosition: "center",
|
|
80
|
+
}}
|
|
81
|
+
></div>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="p-2 bd-highlight align-self-center ms-5">
|
|
84
|
+
{" "}
|
|
85
|
+
<div
|
|
86
|
+
role="button"
|
|
87
|
+
className="rounded-circle border onImageArrow d-flex justify-content-center"
|
|
88
|
+
onClick={() => handleArrowClickInMainImage("right")}
|
|
89
|
+
>
|
|
90
|
+
<img
|
|
91
|
+
src={blcIconArrowRight}
|
|
92
|
+
className="blackArrow align-self-center"
|
|
93
|
+
alt="Right Arrow"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div className="d-flex flex-row">
|
|
99
|
+
{/* Arrows on the main image */}
|
|
100
|
+
</div>
|
|
101
|
+
<div className="d-flex flex-row gap-4 w-100 secondList ">
|
|
102
|
+
<div className="col-lg-12 d-flex flex-row p-1 align-self-center mt-5">
|
|
103
|
+
<div className="col-12 position-relative d-flex justify-content-center">
|
|
104
|
+
<div
|
|
105
|
+
className="col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto "
|
|
106
|
+
ref={imageListRef}
|
|
107
|
+
>
|
|
108
|
+
{props.pictureUrls.length > 0 && (
|
|
109
|
+
<div className="col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3">
|
|
110
|
+
{props.pictureUrls.map((picture, index) => (
|
|
111
|
+
<div
|
|
112
|
+
key={index}
|
|
113
|
+
className="col-lg-12 h-100 d-flex"
|
|
114
|
+
onClick={() => {
|
|
115
|
+
setCurrentImageIndex(index);
|
|
116
|
+
imageListRef.current!.scrollTo({
|
|
117
|
+
left: index * 150,
|
|
118
|
+
behavior: "smooth",
|
|
119
|
+
});
|
|
120
|
+
}}
|
|
121
|
+
role="button"
|
|
122
|
+
>
|
|
123
|
+
<img
|
|
124
|
+
src={picture.url}
|
|
125
|
+
alt={`Image ${index + 1}`}
|
|
126
|
+
className="col-12 h-100 rounded-3 object-fit-cover"
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
))}
|
|
130
|
+
</div>
|
|
131
|
+
)}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|