nestiq-component-library 1.1.34 → 1.1.35

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.
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import "../PropertyCard/PropertyCard.css";
3
+ interface PopupProps {
4
+ property: {
5
+ city: string;
6
+ historicalProtection: boolean;
7
+ basement: boolean;
8
+ balcony: boolean;
9
+ terrace: boolean;
10
+ guestBathroom: boolean;
11
+ bathrooms: string;
12
+ usableArea: string;
13
+ id: string;
14
+ rooms: string;
15
+ constructedArea: string;
16
+ evaluation?: {
17
+ askingPrice: number;
18
+ };
19
+ pictures: {
20
+ contentUrl: string;
21
+ }[];
22
+ };
23
+ onClick: any;
24
+ baseUrl: string;
25
+ title: string;
26
+ }
27
+ export default function PropertyCard(props: PopupProps): React.JSX.Element;
28
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestiq-component-library",
3
- "version": "1.1.34",
3
+ "version": "1.1.35",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,368 @@
1
+ .padding-global {
2
+ height: 737px !important;
3
+ padding: 0 40px;
4
+ }
5
+ .header {
6
+ font-size: 48px;
7
+ font-weight: 600;
8
+ color: #1b1b1b;
9
+ }
10
+ .listing-compacts {
11
+ align-self: stretch;
12
+ flex-grow: 1;
13
+ display: flex;
14
+ flex-direction: column;
15
+ justify-content: flex-start;
16
+ align-items: flex-start;
17
+ gap: 16px;
18
+ padding: 32px;
19
+ border-radius: 0px 32px 32px 0px;
20
+ /* box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); */
21
+ background-color: rgba(58, 58, 58, 0.068);
22
+ height: 460px;
23
+ }
24
+ .cardStyles {
25
+ width: 410px;
26
+ max-width: 2405px;
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ height: 460px;
31
+ border-radius: 32px 0px 0px 32px !important;
32
+ }
33
+ .cardTag {
34
+ width: 75px;
35
+ height: 30px;
36
+ flex-grow: 0;
37
+ display: flex;
38
+ flex-direction: row;
39
+ justify-content: flex-start;
40
+ align-items: center;
41
+ gap: 6px;
42
+ padding: 0 24px;
43
+ border-radius: 16px;
44
+ border: solid 1px #313131;
45
+ background-color: #fff;
46
+ }
47
+ .Grundriss {
48
+ width: 120px;
49
+ height: 30px;
50
+ flex-grow: 0;
51
+ display: flex;
52
+ flex-direction: row;
53
+ justify-content: center;
54
+ align-items: center;
55
+ gap: 10px;
56
+ font-size: 14px;
57
+ border-radius: 16px;
58
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
59
+ background: linear-gradient(to top, #000, #666);
60
+ }
61
+ .Frame-136 {
62
+ height: 119px;
63
+ align-self: stretch;
64
+ flex-grow: 0;
65
+ display: flex;
66
+ flex-direction: row;
67
+ justify-content: flex-start;
68
+ align-items: center;
69
+ gap: 16px;
70
+ padding: 10px 16px;
71
+ border-radius: 16px;
72
+ border: solid 1px rgba(0, 0, 0, 0.1);
73
+ background-color: #fff;
74
+ }
75
+ .kontactbutton {
76
+ width: 180px;
77
+ height: 43px;
78
+ flex-grow: 0;
79
+ display: flex;
80
+ flex-direction: row;
81
+ justify-content: center;
82
+ align-items: center;
83
+ gap: 10px;
84
+ border-radius: 16px;
85
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
86
+ background: linear-gradient(to top, #000, #666);
87
+ }
88
+ .kontact-button-text {
89
+ flex-grow: 0;
90
+ font-family: Inter;
91
+ font-size: 16px;
92
+ font-weight: 500;
93
+ font-stretch: normal;
94
+ font-style: normal;
95
+ line-height: normal;
96
+ letter-spacing: normal;
97
+ text-align: center;
98
+ color: #fff;
99
+ }
100
+ .propertyTitle {
101
+ display: flex;
102
+ flex-grow: 0;
103
+ font-family: Inter;
104
+ font-size: 24px;
105
+ font-weight: 580;
106
+ font-stretch: normal;
107
+ font-style: normal;
108
+ line-height: normal;
109
+ letter-spacing: normal;
110
+ text-align: start;
111
+ color: #313131;
112
+ }
113
+ .firstLabel {
114
+ width: 100px;
115
+ height: 25px;
116
+ gap: 6px;
117
+ border-radius: 16px;
118
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
119
+ border: solid 1px #031012 !important;
120
+ background-color: var(--main-yellow);
121
+ }
122
+
123
+ .secondLabel {
124
+ width: 85px;
125
+ height: 25px;
126
+ padding: 0 7px;
127
+ border-radius: 16px;
128
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
129
+ border: solid 1px #000;
130
+ background-color: #fff;
131
+ }
132
+
133
+ .thirdLabels {
134
+ width: 110px;
135
+ height: 25px;
136
+ border-radius: 16px;
137
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
138
+ border: solid 1px #000;
139
+ background-color: #fff;
140
+ display: flex;
141
+ }
142
+
143
+ .fourthLabels {
144
+ padding: 2px;
145
+
146
+ width: 100px;
147
+ height: 25px;
148
+ border-radius: 16px;
149
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
150
+ border: solid 1px #000;
151
+ background-color: #fff;
152
+ }
153
+
154
+ .layersVector {
155
+ width: 15.1px;
156
+ height: 16px;
157
+ }
158
+
159
+ .layersText {
160
+ font-size: 14px;
161
+ color: #1b1b1b;
162
+ }
163
+
164
+ .style-img {
165
+ object-fit: cover;
166
+ border-radius: 30px !important;
167
+ }
168
+
169
+ .Vector {
170
+ width: 12px;
171
+ height: 16.1px;
172
+ flex-grow: 0;
173
+ margin: 0.4px 6px 0.4px 0;
174
+ }
175
+
176
+ .customButton {
177
+ width: 262px;
178
+ height: 43px;
179
+ color: #000;
180
+ cursor: pointer;
181
+ border-color: #161410;
182
+ background-color: #181716;
183
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
184
+ }
185
+ .button_text {
186
+ font-size: 16px;
187
+ font-weight: 500;
188
+ color: #1b1b1b;
189
+ }
190
+
191
+ .heartVector {
192
+ width: 23px;
193
+ height: 26.7px;
194
+ cursor: pointer;
195
+ }
196
+
197
+ .heartVector.liked {
198
+ fill: rgb(255, 255, 255) !important;
199
+ }
200
+ .locationTexts {
201
+ font-size: 14px;
202
+ color: #344041;
203
+ text-align: center;
204
+ }
205
+
206
+ .arrowVector {
207
+ width: 23px;
208
+ height: 23px;
209
+ flex-grow: 0;
210
+ object-fit: contain;
211
+ }
212
+
213
+ .Price {
214
+ font-size: 26px;
215
+ font-weight: 500;
216
+ font-stretch: normal;
217
+ font-style: normal;
218
+ line-height: normal;
219
+ letter-spacing: normal;
220
+ text-align: center;
221
+ color: #ffffff;
222
+ }
223
+
224
+ .details {
225
+ font-size: 14px;
226
+ text-align: center;
227
+ color: #344041;
228
+ }
229
+ .value {
230
+ font-size: 20px;
231
+ text-align: center;
232
+ font-weight: 500;
233
+ }
234
+
235
+ .class {
236
+ background-color: #1b1b1b;
237
+ }
238
+
239
+ .header {
240
+ height: 64px;
241
+ justify-content: center;
242
+ }
243
+
244
+ .rightConer {
245
+ width: 200px;
246
+ }
247
+ @media all and (min-width: 2560px) {
248
+ .header {
249
+ font-size: 38px;
250
+
251
+ display: flex;
252
+ }
253
+ .cardStyle {
254
+ gap: 0px;
255
+ width: 350px;
256
+ height: 300px;
257
+ /* margin-left: 250px; */
258
+ }
259
+ }
260
+ @media (max-width: 1399px) {
261
+ .header {
262
+ font-size: 38px;
263
+ align-self: center;
264
+ margin-left: 150px;
265
+ }
266
+ .cardStyle {
267
+ gap: 0px;
268
+ width: 350px;
269
+ height: 300px;
270
+ }
271
+ }
272
+
273
+ @media (max-width: 1199px) {
274
+ .header {
275
+ font-size: 38px;
276
+ }
277
+ .cardStyle {
278
+ width: 300px;
279
+ height: 250px;
280
+ }
281
+ }
282
+
283
+ @media (max-width: 575px) {
284
+ .detail {
285
+ font-size: 11px;
286
+ padding: 2px;
287
+ }
288
+ .Price {
289
+ font-size: 19px;
290
+ }
291
+ .header {
292
+ font-size: 28px;
293
+ }
294
+ .locationText {
295
+ font-size: 12px;
296
+ }
297
+ .customButton {
298
+ width: 200px !important;
299
+ }
300
+ .button_text {
301
+ font-size: 13px;
302
+ }
303
+ }
304
+
305
+ @media (max-width: 375px) {
306
+ .labelTopClass {
307
+ width: 105px !important;
308
+ }
309
+ .layersText {
310
+ font-size: 9px;
311
+ }
312
+ .firstLabel {
313
+ gap: 2px;
314
+ }
315
+ .layersVector {
316
+ width: 9px;
317
+ height: 10px;
318
+ gap: 0px;
319
+ }
320
+ .cardStyle {
321
+ width: 320px !important;
322
+ height: 220px !important;
323
+ }
324
+ .header {
325
+ font-size: 24px;
326
+ }
327
+ .detail {
328
+ font-size: 10px;
329
+ padding: 2px;
330
+ }
331
+ .Price {
332
+ font-size: 18px;
333
+ }
334
+ .locationText {
335
+ font-size: 10px;
336
+ }
337
+ .Vector {
338
+ width: 8px;
339
+ height: 16px;
340
+ margin: 0px 2px 0.4px;
341
+ }
342
+ }
343
+
344
+ @media (max-width: 280px) {
345
+ .cardStyle {
346
+ width: 260px !important;
347
+ height: 160px !important;
348
+ }
349
+ .detail {
350
+ margin-bottom: 5px;
351
+ font-size: 0.6ch;
352
+ }
353
+ .Price {
354
+ font-size: 9px;
355
+ }
356
+ .locationText {
357
+ font-size: 6px;
358
+ }
359
+ .Vector {
360
+ width: 7px;
361
+ height: 10px;
362
+ margin: 0px 2px 4px;
363
+ }
364
+ .heartVector {
365
+ width: 15px;
366
+ height: 20px;
367
+ }
368
+ }
@@ -0,0 +1,274 @@
1
+ import React, { useRef, useState } from "react";
2
+ // import { FormattedMessage } from "react-intl";
3
+ import locationIcon from "../../../assets/Images/locationIcon.svg";
4
+ import "../PropertyCard/PropertyCard.css";
5
+ import noImageIcon from "../../../assets/Images/default-property.jpg";
6
+ import { formatPrice } from "../../functions/util";
7
+ import shareIcon from "../../../assets/Images/icon_share 1.svg";
8
+ import moreIcon from "../../../assets/Images/more.svg";
9
+ import arrowLeft from "../../../assets/Images/card-arrow-left.svg";
10
+ import arrowRight from "../../../assets/Images/card-arrow-right.svg";
11
+ import iconLayers from "../../../assets/Images/layer_icon.svg";
12
+ import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
13
+ import MessagePopUp from "../Popup/Popup";
14
+ import SharePopup from "../SharePopup/SharePopup";
15
+
16
+
17
+ interface PopupProps {
18
+ property: {
19
+ city: string;
20
+ historicalProtection: boolean;
21
+ basement: boolean;
22
+ balcony: boolean;
23
+ terrace: boolean;
24
+ guestBathroom: boolean;
25
+ bathrooms: string;
26
+ usableArea: string;
27
+ id: string;
28
+ rooms: string;
29
+ constructedArea: string;
30
+ evaluation?: {
31
+ askingPrice: number;
32
+ };
33
+ pictures: { contentUrl: string }[];
34
+ };
35
+ onClick: any;
36
+ baseUrl: string;
37
+ title: string;
38
+ }
39
+ export default function PropertyCard(props: PopupProps) {
40
+ const [liked, setLiked] = useState(false);
41
+ const [mainImage, setMainImage] = useState<string | null>(null);
42
+ const [currentImageIndex, setCurrentImageIndex] = useState(0);
43
+ const imageListRef = useRef<HTMLDivElement>(null);
44
+ const [floorPlan, setFloorPlan] = useState(false);
45
+ const [messagePopUp, setMessagPopUp] = useState(false);
46
+ const [sharePopUp, setSharePopUp] = useState(false);
47
+
48
+ const pictureUrls =
49
+ props.property?.pictures?.length > 0
50
+ ? props.property.pictures.map(
51
+ (picture) => `${props.baseUrl}${picture.contentUrl}`
52
+ )
53
+ : [noImageIcon];
54
+
55
+ // setPictureUrls(pictureUrls);
56
+ const handleLike = () => {
57
+ setLiked(!liked);
58
+ };
59
+ const floorPlanOnClick = () => {
60
+ setFloorPlan(true);
61
+ };
62
+ const handleMessagPopUp = () => {
63
+ setMessagPopUp(true);
64
+ };
65
+ const handleSharePopUp = () => {
66
+ setSharePopUp(true);
67
+ };
68
+ const handleClosePopup = () =>{
69
+ setFloorPlan(false);
70
+ setMessagPopUp(false);
71
+ }
72
+ const handleArrowClickInMainImage = (direction: string) => {
73
+ if (!props.property || pictureUrls.length === 0) return;
74
+
75
+ let newIndex = currentImageIndex;
76
+ if (direction === "left") {
77
+ newIndex =
78
+ (currentImageIndex - 1 + pictureUrls.length) % pictureUrls.length;
79
+ } else if (direction === "right") {
80
+ newIndex = (currentImageIndex + 1) % pictureUrls.length;
81
+ }
82
+
83
+ setCurrentImageIndex(newIndex);
84
+ setMainImage(pictureUrls[newIndex]);
85
+
86
+ // Ensure the ref exists before calling scrollTo
87
+ if (imageListRef.current) {
88
+ imageListRef.current.scrollTo({
89
+ left: newIndex * 150,
90
+ behavior: "smooth",
91
+ });
92
+ } else {
93
+ console.warn("imageListRef is not set");
94
+ }
95
+ };
96
+
97
+ return (
98
+ <div className="d-flex flex-row ">
99
+ <div className="d-flex flex-column">
100
+ <div
101
+ key={props.property.id}
102
+ className="card-body mb-4 position-relative cardStyles"
103
+ style={{
104
+ backgroundImage: `url(${mainImage || pictureUrls[0]})`,
105
+ backgroundSize: "cover",
106
+ backgroundPosition: "center",
107
+ }}
108
+ >
109
+ <div className="d-flex flex-row justify-content-between gap-5">
110
+ <div
111
+ className="d-flex"
112
+ style={{ position: "absolute", left: "0" }}
113
+ onClick={() => handleArrowClickInMainImage("left")}
114
+ role="button"
115
+ >
116
+ <img src={arrowLeft} />
117
+ </div>
118
+ <div></div>
119
+ <div
120
+ onClick={() => handleArrowClickInMainImage("right")}
121
+ role="button"
122
+ >
123
+ <img
124
+ src={arrowRight}
125
+ style={{ position: "absolute", right: "0" }}
126
+ />
127
+ </div>
128
+ </div>
129
+ <div
130
+ className="d-flex flex-row align-self-end justify-item-start justify-content-between align-item-start gap-1 mb-2 ms-4"
131
+ style={{ position: "absolute", left: "0" }}
132
+ >
133
+ <div className="cardTag">{`${currentImageIndex + 1}/${
134
+ pictureUrls.length
135
+ }`}</div>
136
+ <div
137
+ className="Grundriss kontact-button-text "
138
+ role="button"
139
+ onClick={floorPlanOnClick}
140
+ >
141
+ <img src={iconLayers} className="" style={{ width: "18px" }} />{" "}
142
+ Grundriss
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ <div className="d-flex flex-column listing-compacts col-12">
148
+ <div className="d-flex align-self-end justify-content-end gap-2">
149
+ <img
150
+ src={shareIcon}
151
+ alt="Location Icon"
152
+ className="w-50 "
153
+ onClick={handleSharePopUp}
154
+ />
155
+ <img src={moreIcon} alt="Location Icon" className="" />
156
+ </div>
157
+ <div>
158
+ <span className="propertyTitle align-items-start ">
159
+ Charmante Altbauwohnung in zentraler Lage – ideal für Familien oder
160
+ Paare
161
+ {props.title}
162
+ </span>
163
+ </div>
164
+ <div>
165
+ {" "}
166
+ <div className="d-flex ">
167
+ <img src={locationIcon} alt="Location Icon" className="Vector" />
168
+ <span className="locationTexts ">
169
+ {props.property.city || "N/A"}
170
+ </span>
171
+ </div>
172
+ </div>
173
+ <div className="d-flex flex-row ">
174
+ <div className="d-flex col-5">
175
+ <span className="value ">
176
+ {formatPrice(props.property?.evaluation?.askingPrice ?? 0)} €
177
+ <br />
178
+ <span className="details">Kaufpreis</span>
179
+ </span>
180
+ </div>
181
+ <span className="text-dark value col-lg-4 col-md-4 col-sm-6 text-truncate ">
182
+ {+props.property.rooms}
183
+ <br />
184
+ <span className="details">
185
+ {" "}
186
+ <span>Zimmer</span>
187
+ </span>
188
+ </span>
189
+ <span className="text-dark value col-lg-3 col-md-3 col-sm-4 text-truncate ">
190
+ {+props.property.bathrooms}
191
+ <br />
192
+ <span className="details">
193
+ <span>Bad</span>
194
+ </span>
195
+ </span>
196
+ <span className="text-dark value col-lg-6 col-md-5 col-sm-7 me-3">
197
+ {props.property.usableArea} m²
198
+ <br />
199
+ <span className="details">
200
+ <span>Wohnfläche</span>
201
+ </span>
202
+ </span>
203
+ </div>
204
+ <div className="labelTopClass d-flex top-0 start-0 col-sm-5 col-lg-8 ">
205
+ <div className=" align-items-center d-flex flex-row gap-2">
206
+ {props.property.historicalProtection && (
207
+ <label className="thirdLabels justify-content-center align-items-center">
208
+ <span className="layersText ">{"Denkmalschutz"}</span>
209
+ </label>
210
+ )}
211
+
212
+ {props.property.basement && (
213
+ <label className="secondLabel justify-content-center align-items-center">
214
+ <span className="layersText ">{"Keller"}</span>
215
+ </label>
216
+ )}
217
+ {props.property.balcony && (
218
+ <label className="secondLabel justify-content-center align-items-center">
219
+ <span className="layersText ">{"Balkon"}</span>
220
+ </label>
221
+ )}
222
+ </div>
223
+ </div>
224
+ <div className="d-flex flex-row align-items-center gap-2">
225
+ {props.property.terrace && (
226
+ <label className="thirdLabels justify-content-center align-items-center ">
227
+ <span className="layersText">{"Terrace"}</span>
228
+ </label>
229
+ )}
230
+ <div className="d-flex ">
231
+ {props.property.guestBathroom && (
232
+ <label className="col-1 thirdLabels justify-content-center align-items-center ">
233
+ <span className="layersText ">{"Gäste-WC"}</span>
234
+ </label>
235
+ )}
236
+ </div>
237
+ </div>
238
+ <div className="Frame-136 d-flex flex-row">
239
+ <div className="d-flex flex-column col-5 justify-content-between">
240
+ <span className="h4">
241
+ <strong>McGrath</strong>{" "}
242
+ </span>
243
+ </div>
244
+ <div className="d-flex flex-column justify-content-between">
245
+ <span>
246
+ <strong>Herr John McGrath</strong>{" "}
247
+ </span>
248
+ <span>McGrath</span>
249
+ <button
250
+ className="kontactbutton text-light "
251
+ onClick={handleMessagPopUp}
252
+ role="button"
253
+ >
254
+ <span className="kontact-button-text">Kontakt aufnehmen </span>
255
+ </button>
256
+ </div>
257
+ </div>
258
+ </div>
259
+ {floorPlan && (
260
+ <FloorPlanPopup
261
+ contentUrl={props.property.pictures[0]?.contentUrl || noImageIcon}
262
+ onCloseClick={() => setFloorPlan(false)}
263
+ />
264
+ )}
265
+ {/* {messagePopUp && (
266
+ <MessagePopUp
267
+ onClick={() => setMessagPopUp(false)}
268
+ property={props.property}
269
+ />
270
+ )} */}
271
+ {sharePopUp && <SharePopup onClick={() => setSharePopUp(false)} />}
272
+ </div>
273
+ );
274
+ }