nestiq-component-library 1.1.172 → 1.2.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 (111) hide show
  1. package/dist/index.cjs +8 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.js +1670 -733
  4. package/dist/index.js.map +1 -1
  5. package/dist/style.css +1 -0
  6. package/package.json +27 -26
  7. package/dist/assets/images/Icon_rightArrow.bced4a705c07148d.svg +0 -3
  8. package/dist/assets/images/LayersIcon.34c085c352a2c9c8.svg +0 -5
  9. package/dist/assets/images/blackarrow-Right.e585ae62dd55abae.svg +0 -3
  10. package/dist/assets/images/blckarrow-Left.e2134741aa368d30.svg +0 -3
  11. package/dist/assets/images/card-arrow-left.55343410142dad3f.svg +0 -4
  12. package/dist/assets/images/card-arrow-right.60b3bf0e34c1800d.svg +0 -4
  13. package/dist/assets/images/chevron-left.04f0a7f16b745c1a.svg +0 -3
  14. package/dist/assets/images/close.b5ce9141e80c688b.png +0 -0
  15. package/dist/assets/images/default-property.9987f19670be82b6.jpg +0 -0
  16. package/dist/assets/images/envelope-fill.6669c9d64183941c.svg +0 -3
  17. package/dist/assets/images/facebook.ce73eacbfffe8a27.svg +0 -3
  18. package/dist/assets/images/icon_checkmark.9b48c4a4bc651b08.svg +0 -10
  19. package/dist/assets/images/icon_close_2.e41bb9a4db48e048.png +0 -0
  20. package/dist/assets/images/icon_gallery.269b721daf2ca907.svg +0 -4
  21. package/dist/assets/images/icon_map.2318ec664c3e615e.svg +0 -10
  22. package/dist/assets/images/icon_share_1.b9ec05630dc1087e.svg +0 -3
  23. package/dist/assets/images/imooly.b46514ac970e6052.svg +0 -7
  24. package/dist/assets/images/layer_icon.9b56c187199c44b5.svg +0 -5
  25. package/dist/assets/images/linkedin.7539333145b03678.svg +0 -3
  26. package/dist/assets/images/locationIcon.961de080757bda41.svg +0 -4
  27. package/dist/assets/images/locationIconBlack.eb8e9e9226b43573.svg +0 -4
  28. package/dist/assets/images/mail-icon.176f921aa16b9a3d.png +0 -0
  29. package/dist/assets/images/more.ce14789c8d37e327.svg +0 -12
  30. package/dist/assets/images/twitter-x.48a4ac3f560f0a62.svg +0 -3
  31. package/dist/assets/images/warning.6f99cb4c6a048b47.svg +0 -11
  32. package/dist/assets/images/whatsapp.28e6b0b24adc9289.svg +0 -3
  33. package/dist/components/Button/Button.d.ts +0 -6
  34. package/dist/components/ErrorPopup/ErrorPopup.d.ts +0 -7
  35. package/dist/components/FloorPlanPopup/FloorPlanPopup.d.ts +0 -7
  36. package/dist/components/ImageListPopup/ImageListPopup.d.ts +0 -12
  37. package/dist/components/MessagePopup/MessagePopUp.d.ts +0 -16
  38. package/dist/components/MessagePopup/SuccessPopup.d.ts +0 -7
  39. package/dist/components/NewPropertyCard/NewPropertyCard.d.ts +0 -55
  40. package/dist/components/Popup/Popup.d.ts +0 -9
  41. package/dist/components/PropertyCard/PropertyCard.d.ts +0 -27
  42. package/dist/components/PropertyDetailsHeader/PropertyDetailsHeader.d.ts +0 -20
  43. package/dist/components/PropertyImageList/PropertyImageList.d.ts +0 -29
  44. package/dist/components/SharePopup/SharePopup.d.ts +0 -8
  45. package/dist/components/ToastWrapper/ToastWrapper.d.ts +0 -4
  46. package/dist/functions/util.d.ts +0 -2
  47. package/dist/index.d.ts +0 -15
  48. package/dist/index.es.js +0 -742
  49. package/dist/index.es.js.map +0 -1
  50. package/dist/models/message.model.d.ts +0 -7
  51. package/rollup.config.mjs +0 -36
  52. package/src/assets/images/Icon_rightArrow.svg +0 -3
  53. package/src/assets/images/LayersIcon.svg +0 -5
  54. package/src/assets/images/blackarrow-Right.svg +0 -3
  55. package/src/assets/images/blckarrow-Left.svg +0 -3
  56. package/src/assets/images/card-arrow-left.svg +0 -4
  57. package/src/assets/images/card-arrow-right.svg +0 -4
  58. package/src/assets/images/chevron-left.svg +0 -3
  59. package/src/assets/images/close.png +0 -0
  60. package/src/assets/images/default-property.jpg +0 -0
  61. package/src/assets/images/envelope-fill.svg +0 -3
  62. package/src/assets/images/facebook.svg +0 -3
  63. package/src/assets/images/heart.svg +0 -3
  64. package/src/assets/images/house.jpg +0 -0
  65. package/src/assets/images/icon_checkmark.svg +0 -10
  66. package/src/assets/images/icon_close 2.png +0 -0
  67. package/src/assets/images/icon_close_2.png +0 -0
  68. package/src/assets/images/icon_gallery.svg +0 -4
  69. package/src/assets/images/icon_home.svg +0 -3
  70. package/src/assets/images/icon_map.svg +0 -10
  71. package/src/assets/images/icon_share_1.svg +0 -3
  72. package/src/assets/images/imooly.svg +0 -7
  73. package/src/assets/images/layer_icon.svg +0 -5
  74. package/src/assets/images/linkedin.svg +0 -3
  75. package/src/assets/images/locationIcon.svg +0 -4
  76. package/src/assets/images/locationIconBlack.svg +0 -4
  77. package/src/assets/images/mail-icon.png +0 -0
  78. package/src/assets/images/more.svg +0 -12
  79. package/src/assets/images/twitter-x.svg +0 -3
  80. package/src/assets/images/warning.svg +0 -11
  81. package/src/assets/images/whatsapp.svg +0 -3
  82. package/src/components/Button/Button.tsx +0 -11
  83. package/src/components/ErrorPopup/ErrorPopup.tsx +0 -63
  84. package/src/components/ErrorPopup/PopUp.css +0 -409
  85. package/src/components/FloorPlanPopup/FloorPlanPopup.css +0 -3
  86. package/src/components/FloorPlanPopup/FloorPlanPopup.tsx +0 -83
  87. package/src/components/ImageListPopup/ImageListPopup.css +0 -113
  88. package/src/components/ImageListPopup/ImageListPopup.tsx +0 -154
  89. package/src/components/MessagePopup/MessagePopUp.css +0 -196
  90. package/src/components/MessagePopup/MessagePopUp.tsx +0 -160
  91. package/src/components/MessagePopup/PopUp.css +0 -408
  92. package/src/components/MessagePopup/SuccessPopup.tsx +0 -64
  93. package/src/components/NewPropertyCard/NewPropertyCard.css +0 -413
  94. package/src/components/NewPropertyCard/NewPropertyCard.tsx +0 -383
  95. package/src/components/Popup/Popup.css +0 -12
  96. package/src/components/Popup/Popup.tsx +0 -29
  97. package/src/components/PropertyCard/PropertyCard.css +0 -271
  98. package/src/components/PropertyCard/PropertyCard.tsx +0 -137
  99. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.css +0 -94
  100. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +0 -106
  101. package/src/components/PropertyImageList/PropertyImageList.css +0 -101
  102. package/src/components/PropertyImageList/PropertyImageList.tsx +0 -254
  103. package/src/components/SharePopup/SharePopup.css +0 -348
  104. package/src/components/SharePopup/SharePopup.tsx +0 -143
  105. package/src/components/ToastWrapper/ToastWrapper.tsx +0 -25
  106. package/src/functions/util.ts +0 -14
  107. package/src/index.tsx +0 -26
  108. package/src/models/message.model.ts +0 -7
  109. package/src/styles/common.css +0 -17
  110. package/src/types/images.d.ts +0 -25
  111. package/tsconfig.json +0 -22
@@ -1,137 +0,0 @@
1
- import React, { useState } from "react";
2
- // import { FormattedMessage } from "react-intl";
3
- import layerIcon from "../../assets/images/LayersIcon.svg";
4
- import heart from "../../assets/images/heart.svg";
5
- import locationIcon from "../../assets/images/locationIcon.svg";
6
- import "./PropertyCard.css";
7
- import noImageIcon from "../../assets/images/default-property.jpg";
8
- import { formatPrice, formatPropertyArea } from "../../functions/util";
9
-
10
- interface PopupProps {
11
- property: {
12
- city: string;
13
- historicalProtection: boolean;
14
- basement: boolean;
15
- balcony: boolean;
16
- terrace: boolean;
17
- guestBathroom: boolean;
18
- bathrooms: string;
19
- usableArea: string;
20
- id: string;
21
- rooms: string;
22
- constructedArea: string;
23
- evaluation?: {
24
- askingPrice: number;
25
- };
26
- pictures: { contentUrl: string }[];
27
- };
28
- onClick: any;
29
- baseUrl: string;
30
- }
31
-
32
- export default function PropertyCard(props: PopupProps) {
33
- const [liked, setLiked] = useState(false);
34
-
35
- const handleLike = () => {
36
- setLiked(!liked);
37
- };
38
- const pictureUrl =
39
- props.property.pictures && props.property.pictures.length > 0
40
- ? `${props.baseUrl}${props.property.pictures[0].contentUrl}`
41
- : noImageIcon;
42
- return (
43
- <div
44
- key={props.property.id}
45
- className="card-body me-4 mb-4 position-relative cardStyle"
46
- style={{
47
- backgroundImage: `url(${pictureUrl})`,
48
- backgroundSize: "cover",
49
- backgroundPosition: "center",
50
- }}
51
- onClick={props.onClick}
52
- role="button"
53
- >
54
- <div className="labelTopClass position-absolute top-0 start-0 col-sm-5 col-lg-8">
55
- <div className="d-flex align-items-center ms-2 mb-1 mt-2 gap-2">
56
- <label className="p-1 firstLabel d-flex flex-row justify-content-center align-items-center">
57
- <img src={layerIcon} alt="Location Icon" className="layersVector" />
58
- <span className="layersText">{"Grundriss"}</span>
59
- </label>
60
- {props.property.historicalProtection && (
61
- <label className="thirdLabels d-flex flex-row justify-content-center align-items-center">
62
- <span className="layersText p-1">{"Denkmalschutz"}</span>
63
- </label>
64
- )}
65
-
66
- {props.property.basement && (
67
- <label className="secondLabel d-flex flex-row justify-content-center align-items-center">
68
- <span className="layersText p-1">{"Keller"}</span>
69
- </label>
70
- )}
71
- </div>
72
- <div className="d-flex align-items-center ms-2 start-0 gap-2">
73
- {props.property.terrace && (
74
- <label className="p-1 thirdLabels d-flex flex-row justify-content-center align-items-center ">
75
- <span className="layersText">{"Terrace"}</span>
76
- </label>
77
- )}
78
- {props.property.balcony && (
79
- <label className="secondLabel d-flex flex-row justify-content-center align-items-center">
80
- <span className="layersText p-1">{"Balkon"}</span>
81
- </label>
82
- )}
83
-
84
- {props.property.guestBathroom && (
85
- <label className="col-1 fourthLabels d-flex flex-row justify-content-center align-items-center ">
86
- <span className="layersText p-1">{"Gäste-WC"}</span>
87
- </label>
88
- )}
89
- </div>
90
- </div>
91
- <div className="d-flex align-items-center position-absolute top-0 end-0 p-3">
92
- {/*<img*/}
93
- {/* src={heart}*/}
94
- {/* alt=" Heart Icon"*/}
95
- {/* className={`heartVector ${liked ? "liked" : ""}`}*/}
96
- {/* onClick={handleLike}*/}
97
- {/*/>*/}
98
- </div>
99
- <div className="d-flex align-items-center mb-3 position-absolute bottom-0 start-0 p-2">
100
- <span className="Price col-lg-12 col-md-12 col-sm-12 text-truncate p-1">
101
- {formatPrice(props.property?.evaluation?.askingPrice ?? 0)} €
102
- </span>
103
- </div>
104
- <div className="d-flex w-50 align-items-center position-absolute bottom-0 start-0 p-2">
105
- <img src={locationIcon} alt="Location Icon" className="Vector" />
106
- <span className="locationText text-truncate">
107
- {props.property.city || "N/A"}
108
- </span>
109
- </div>
110
- <div className="d-flex col-lg-6 col-md-6 col-sm-5 me-lg-0 me-md-0 me-sm-3 justify-content-center mb-2 position-absolute bottom-0 end-0">
111
- <span className="detail col-lg-4 col-md-4 col-sm-6 text-truncate border-end ">
112
- {+props.property.rooms}
113
- <br />
114
- {/* <FormattedMessage id="ROOMS" /> */}
115
- <span>Zimmer</span>
116
- </span>
117
- <span className="detail col-lg-3 col-md-3 col-sm-4 text-truncate ">
118
- {+props.property.bathrooms}
119
- <br />
120
- {/* <FormattedMessage
121
- id="BATHROOM"
122
- values={{ itemCount: +props.property.bathrooms }}
123
- /> */}
124
- {/* {+props.property.bathrooms} */}
125
-
126
- <span>Bad</span>
127
- </span>
128
- <span className="detail col-lg-5 col-md-5 col-sm-7 text-truncate border-start me-3">
129
- {formatPropertyArea(props.property?.constructedArea)} m²
130
- <br />
131
- {/* <FormattedMessage id="LIVING_SPACE" /> */}
132
- <span>Wohnfläche</span>
133
- </span>
134
- </div>
135
- </div>
136
- );
137
- }
@@ -1,94 +0,0 @@
1
- .compact_cc {
2
- padding: 32px;
3
- height: 194px;
4
- border-radius: 32px;
5
- box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
6
- background-color: #f2f2f2;
7
- }
8
-
9
- .header_Text {
10
- margin-top: 140px;
11
- font-size: 32px;
12
- line-height: normal;
13
- color: #1b1b1b;
14
- }
15
- .location {
16
- left: 0;
17
- }
18
- .vector svg {
19
- width: 6px;
20
- height: 21.5px;
21
- flex-grow: 0;
22
- margin: 4.2px 10px 4.2px 0;
23
- fill: #344041;
24
- cursor: pointer;
25
- }
26
-
27
- .textWrapper {
28
- height: 20px;
29
- }
30
-
31
- .propText {
32
- font-size: 16px;
33
- letter-spacing: normal;
34
- text-align: center;
35
- color: #344041;
36
- }
37
-
38
- .v_share {
39
- cursor: pointer;
40
- }
41
-
42
- .fetch_section {
43
- margin-top: 90px;
44
- height: 60px;
45
- }
46
- @media (min-width: 800px) {
47
- .Pheader {
48
- max-width: 1750px;
49
- margin: 0 auto;
50
- }
51
- }
52
- @media (min-width: 300px) and (max-width: 670px) {
53
- .Pheader {
54
- height: 700px;
55
- }
56
- .compact {
57
- border-radius: 32px;
58
- box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
59
- background-color: #f2f2f2;
60
- }
61
- .compact2 {
62
- position: relative !important;
63
- display: flex !important;
64
- align-self: flex-start !important;
65
- margin-left: 25px;
66
- justify-content: start !important;
67
- align-items: flex-start !important;
68
- }
69
- .compact3 {
70
- position: relative !important;
71
- display: flex !important;
72
- margin-left: 30px;
73
- margin-top: 10px !important;
74
- }
75
- .header_Text {
76
- margin-top: 0px;
77
- }
78
- .fetch_section {
79
- margin-top: 0px;
80
- height: 60px;
81
- }
82
- .propText {
83
- justify-content: start !important;
84
- align-self: flex-start !important;
85
- text-align: start !important;
86
- }
87
- .propText2 {
88
- justify-content: start !important;
89
- align-self: flex-start !important;
90
- text-align: start !important;
91
- font-weight: 1000;
92
- font-size: 24px;
93
- }
94
- }
@@ -1,106 +0,0 @@
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
- import SharePopup from "../SharePopup/SharePopup";
7
- import { formatPrice, formatPropertyArea } from "../../functions/util";
8
-
9
- export interface PopupProps {
10
- property: {
11
- fullAddress: string;
12
- city: string;
13
- constructedArea: string;
14
- rooms: string;
15
- propertyArea: number;
16
- askingPrice: number;
17
- };
18
- title: string;
19
- translations?: {
20
- kaufpreis?: string;
21
- wohnflache?: string;
22
- zimmer?: string;
23
- grundriss?: string;
24
- };
25
- }
26
-
27
- export default function PropertyDetailsHeader(props: PopupProps) {
28
- const [showPopUp, setShowPopUp] = useState(false);
29
- const area = props.property?.propertyArea;
30
-
31
- const handleOpenPopup = () => setShowPopUp(true);
32
-
33
- const handleClosePopup = () => setShowPopUp(false);
34
-
35
- const t = {
36
- kaufpreis: props.translations?.kaufpreis || "Kaufpreis",
37
- wohnflache: props.translations?.wohnflache || "Wohnfläche",
38
- zimmer: props.translations?.zimmer || "Zimmer",
39
- grundriss: props.translations?.grundriss || "Grundriss",
40
- };
41
-
42
- return (
43
- <div className="compact_cc d-flex flex-column col-12 col-lg-12 mt-3 justify-content-between">
44
- <div className="col-12 d-flex flex-row">
45
- <div className="header_Text d-flex col-lg-11 col-md-11 mt-0">
46
- <strong>{props.title ?? "-"}</strong>
47
- </div>
48
- <div className="d-flex col-lg-1 col-md-1 justify-content-end position-relative">
49
- {/* <img src={Hearticon} alt="Location Icon" className="v_share me-3" /> */}
50
- <img
51
- src={ShareIcon}
52
- alt="share icon"
53
- className="v_share me-3 position-absolute"
54
- onClick={handleOpenPopup}
55
- />
56
- </div>
57
- </div>
58
-
59
- <div className="d-flex flex-row justify-content-between">
60
- <div className="col-6 d-flex flex-row align-items-end jsutify-content-start gap-1">
61
- <div className="d-flex gap-1 justify-content-center">
62
- <div className="d-flex gap-2 align-items-center">
63
- <img src={locationIcon} className="" alt="location Icon" />
64
- </div>
65
- <div className="textWrapper">{props.property?.fullAddress}</div>
66
- </div>
67
- </div>
68
- <div className="d-flex align-items-end gap-3 justify-content-end flex-row col-lg-6 col-md-6 col-sm-5">
69
- {props && (
70
- <div className="propText h-100 d-flex flex-column align-items-center justify-content-center">
71
- <span className="">
72
- {formatPrice(props.property?.askingPrice ?? 0)}€ <br />
73
- </span>
74
- <span className="textWrapper">{t.kaufpreis}</span>
75
- </div>
76
- )}
77
-
78
- {props && (
79
- <div className="propText h-100 d-flex flex-column align-items-center justify-content-center">
80
- <span className="">
81
- {formatPropertyArea(props.property.constructedArea) ?? 0}
82
- </span>
83
- <span className="textWrapper">{t.wohnflache}</span>
84
- </div>
85
- )}
86
- {props && (
87
- <div className="propText h-100 d-flex flex-column align-items-center justify-content-center">
88
- <span className="">{props.property.rooms}</span>
89
- <span className="textWrapper">{t.zimmer}</span>
90
- </div>
91
- )}
92
- {/* {props && (
93
- <div className="propText col-lg-3 col-md-3 d-flex h-100 align-items-center justify-content-center flex-column">
94
- <span className="">
95
- {formatPropertyArea(area ?? 0)} m²
96
- </span>
97
- Grundstück
98
- <FormattedMessage id="Grundstück" />
99
- </div>
100
- )} */}
101
- </div>
102
- </div>
103
- {showPopUp && <SharePopup onClick={() => handleClosePopup()} />}
104
- </div>
105
- );
106
- }
@@ -1,101 +0,0 @@
1
- .mainImage {
2
- height: 80%;
3
- }
4
-
5
- .secondList {
6
- height: 20%;
7
- max-height: 121.6px;
8
- }
9
-
10
- .listImageButton {
11
- background-image: linear-gradient(to top, #000, #666);
12
- align-items: center !important;
13
- justify-content: center !important;
14
- min-height: 121px;
15
- }
16
-
17
- .listImgText {
18
- height: 30px;
19
- font-size: 14px;
20
- line-height: 2.14;
21
- color: #fff;
22
- }
23
-
24
- .arroIconColour {
25
- height: 30px;
26
- fill: #fff !important;
27
- }
28
-
29
- .onImageArrow {
30
- width: 50px;
31
- height: 50px;
32
- padding: 23px 8px;
33
- background-color: rgba(255, 255, 255, 0.8);
34
- }
35
-
36
- .blackArrow {
37
- width: 20px;
38
- height: 20px;
39
- }
40
-
41
-
42
- .imagesArray {
43
- background-size: cover !important;
44
- }
45
- @media (max-width: 450px) {
46
- .Pimagelist {
47
- }
48
- .mainImage {
49
- height: 500px;
50
- width: 88vw;
51
- }
52
- }
53
-
54
- /* @media (min-width: 390px) and (max-width: 850px) {
55
- .Pimagelist {
56
- }
57
- .mainImage {
58
- height: 500px;
59
- width: 58vw;
60
- }
61
- } */
62
- @media (min-width: 768px) and (max-width: 819px) {
63
- .Pimagelist {
64
- }
65
- .mainImage {
66
- height: 80%;
67
- width: 58vw;
68
- }
69
- }
70
- @media (min-width: 820px) and (max-width: 850px) {
71
- .Pimagelist {
72
- }
73
- .mainImage {
74
- height: 80%;
75
- width: 58vw;
76
- }
77
- }
78
-
79
- .image-thumbnail {
80
- position: relative;
81
- transition: opacity 0.3s ease-in-out;
82
- height: 100%;
83
- display: flex;
84
- align-items: center;
85
- justify-content: center;
86
- }
87
-
88
- .image-thumbnail img {
89
- height: 100%;
90
- object-fit: cover;
91
- border-radius: 8px;
92
- }
93
-
94
- .image-thumbnail.greyed-out img {
95
- filter: grayscale(100%) brightness(50%);
96
- }
97
-
98
- .image-thumbnail.selected img {
99
- filter: none;
100
- border: 2px solid #007bff; /* Highlight border for selected image */
101
- }
@@ -1,254 +0,0 @@
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 noImageIcon from "../../assets/Images/default-property.jpg";
10
- import "./PropertyImageList.css";
11
- import ImageListPopup from "../ImageListPopup/ImageListPopup";
12
- import PopupProps from "../ImageListPopup/ImageListPopup";
13
- import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
14
-
15
- interface PopupProps {
16
- pictureUrls: { title: string; url: 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;
30
- }
31
- export default function PropertyImageList(prop: PopupProps) {
32
- const [currentImageIndex, setCurrentImageIndex] = useState(0);
33
- const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
34
- const [isFloorPlanPopupOpen, setIsFloorPlanPopupOpen] = useState(false);
35
- const imageListRef = useRef<HTMLDivElement | null>(null);
36
-
37
- const handleArrowClickInMainImage = (direction: "left" | "right") => {
38
- if (!prop.pictureUrls.length) return;
39
-
40
- setCurrentImageIndex((prevIndex) => {
41
- let newIndex;
42
-
43
- if (direction === "left") {
44
- newIndex =
45
- (prevIndex - 1 + prop.pictureUrls.length) % prop.pictureUrls.length;
46
- } else {
47
- newIndex = (prevIndex + 1) % prop.pictureUrls.length;
48
- }
49
-
50
- if (imageListRef.current) {
51
- imageListRef.current.scrollTo({
52
- left: newIndex * 150,
53
- behavior: "smooth",
54
- });
55
- }
56
- return newIndex || 0;
57
- });
58
- };
59
-
60
- const allPhotos =
61
- prop.property.pictures
62
- ?.filter((p) => p.pictureType?.id === 2)
63
- .map((p, index) => ({
64
- url: prop.baseUrl + p.contentUrl,
65
- title: `Photo ${index + 1}`,
66
- })) || [];
67
-
68
- const floorPlanImages =
69
- prop.property.pictures
70
- ?.filter((p) => p.pictureType?.id === 1)
71
- .map((p, index) => ({
72
- url: prop.baseUrl + p.contentUrl,
73
- title: `Floor Plan ${index + 1}`,
74
- })) || [];
75
-
76
- const toggleAllPhotos = () => {
77
- setIsImagePopupOpen(!isImagePopupOpen);
78
- };
79
-
80
- const floorPlanClickHandler = () => {
81
- setIsFloorPlanPopupOpen(true);
82
- };
83
-
84
- const floorPlanPopupCloseHandler = () => {
85
- setIsFloorPlanPopupOpen(false);
86
- };
87
-
88
- const t = {
89
- allPhotos: prop.translations?.allPhotos || "Alle Fotos",
90
- map: prop.translations?.map || "Karte",
91
- grundriss: prop.translations?.grundriss || "Grundriss",
92
- };
93
-
94
- return (
95
- <div className="col-8 Pimagelist ">
96
- <div
97
- className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
98
- style={{
99
- backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
100
- backgroundSize: "cover",
101
- backgroundPosition: "center",
102
- }}
103
- >
104
- {/* Arrows on the main image */}
105
- <div
106
- className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
107
- role="button"
108
- onClick={() => handleArrowClickInMainImage("left")}
109
- >
110
- <img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
111
- </div>
112
- <div
113
- role="button"
114
- className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
115
- onClick={() => handleArrowClickInMainImage("right")}
116
- >
117
- <img
118
- src={blcIconArrowRight}
119
- className="blackArrow"
120
- alt="Right Arrow"
121
- />
122
- </div>
123
- </div>
124
-
125
- {/* Image Thumbnails */}
126
- <div className="d-none d-md-block">
127
- <div className="mt-1 d-flex flex-row gap-1 col-12 secondList">
128
- <div className=" col-lg-6 col-6 d-flex flex-row py-0 px-1">
129
- <div className=" col-12 position-relative d-flex justify-content-center">
130
- <div
131
- className="col-1 h-100 d-flex position-absolute start-0"
132
- onClick={() => handleArrowClickInMainImage("left")}
133
- role="button"
134
- >
135
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
136
- <img
137
- src={iconArrowLeft}
138
- className="arroIconColour"
139
- alt="Left Arrow"
140
- />
141
- </div>
142
- </div>
143
- <div
144
- className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-hidden"
145
- ref={imageListRef}
146
- >
147
- {prop.pictureUrls.length > 0 && (
148
- <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
149
- {prop.pictureUrls.map((picture, index) => (
150
- <div
151
- key={index}
152
- className={`col-lg-12 h-100 d-flex image-thumbnail ${
153
- index === currentImageIndex
154
- ? "selected"
155
- : "greyed-out"
156
- } ${
157
- index === 0
158
- ? "ms-1"
159
- : index === prop.pictureUrls.length - 1
160
- ? "me-1"
161
- : ""
162
- }`}
163
- onClick={() => {
164
- setCurrentImageIndex(index);
165
- imageListRef.current!.scrollTo({
166
- left: index * 150,
167
- behavior: "smooth",
168
- });
169
- }}
170
- role="button"
171
- >
172
- <img
173
- src={picture.url}
174
- alt={`Image ${index + 1}`}
175
- className="col-12 h-100 rounded-3 object-fit-cover"
176
- />
177
- </div>
178
- ))}
179
- </div>
180
- )}
181
- </div>
182
- <div
183
- className="col-1 h-100 d-flex position-absolute end-0 top-0"
184
- onClick={() => handleArrowClickInMainImage("right")}
185
- role="button"
186
- >
187
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
188
- <img
189
- src={iconArrowRight}
190
- className="arroIconColour "
191
- alt="Right Arrow"
192
- />
193
- </div>
194
- </div>
195
- </div>
196
- </div>
197
-
198
- {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
199
- <div className="col-7 col-lg-6 d-flex flex-row">
200
- <div
201
- className="col-lg-4 col-4 py-0 px-1"
202
- role="button"
203
- onClick={toggleAllPhotos}
204
- >
205
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
206
- <img src={iconGallery} alt="Gallery Icon" />
207
- <span className="listImgText"> {t.allPhotos}</span>
208
- </div>
209
- </div>
210
- <div
211
- className="col-lg-4 col-3 py-0 px-1"
212
- role="button"
213
- onClick={floorPlanClickHandler}
214
- >
215
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
216
- <img src={iconLayers} alt="Layers Icon" />
217
- <span className="listImgText">{t.grundriss}</span>
218
- </div>
219
- </div>
220
- <div
221
- className="col-lg-4 col-3 py-0 px-1"
222
- role="button"
223
- onClick={() =>
224
- window.scrollTo({
225
- top: document.documentElement.scrollHeight,
226
- })
227
- }
228
- >
229
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
230
- <img src={iconMap} alt="Map Icon" />
231
- <span className="listImgText">{t.map}</span>
232
- </div>
233
- </div>
234
- </div>
235
- </div>
236
- </div>
237
- {/* Popup for all photos */}
238
- {isImagePopupOpen && (
239
- <ImageListPopup
240
- pictureUrls={allPhotos}
241
- onClose={() => setIsImagePopupOpen(false)}
242
- />
243
- )}
244
-
245
- {/* Popup for floor plan */}
246
- {isFloorPlanPopupOpen && (
247
- <ImageListPopup
248
- pictureUrls={floorPlanImages}
249
- onClose={() => setIsFloorPlanPopupOpen(false)}
250
- />
251
- )}
252
- </div>
253
- );
254
- }