nestiq-component-library 1.1.54 → 1.1.55
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/MessagePopup/MessagePopUp.d.ts +1 -9
- package/dist/components/NewPropertyCard/NewPropertyCard.d.ts +1 -9
- package/dist/index.es.js +16 -17
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MessagePopup/MessagePopUp.tsx +5 -28
- package/src/components/NewPropertyCard/NewPropertyCard.tsx +6 -11
|
@@ -12,15 +12,7 @@ interface PopupProps {
|
|
|
12
12
|
handleSendMessage: any;
|
|
13
13
|
onClick: any;
|
|
14
14
|
themesList: any;
|
|
15
|
-
|
|
16
|
-
fromUser: string;
|
|
17
|
-
property: string;
|
|
18
|
-
text: string;
|
|
19
|
-
firstName: string;
|
|
20
|
-
lastName: string;
|
|
21
|
-
theme: string;
|
|
22
|
-
subject: string;
|
|
23
|
-
};
|
|
15
|
+
sendDataToParent: any;
|
|
24
16
|
}
|
|
25
17
|
|
|
26
18
|
export default function MessagePopUp(props: PopupProps) {
|
|
@@ -33,30 +25,15 @@ export default function MessagePopUp(props: PopupProps) {
|
|
|
33
25
|
const [firstName, setFirstName] = useState("");
|
|
34
26
|
const [lastName, setLastName] = useState("");
|
|
35
27
|
const [id, setId] = useState("");
|
|
28
|
+
const [data, setData] = useState("");
|
|
36
29
|
|
|
37
30
|
const handleClose = () => {
|
|
38
31
|
props.onClick();
|
|
39
32
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// toast.warning("Please fill in all fields.");
|
|
43
|
-
showToast("Please fill in all fields.", "warning");
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const user = JSON.parse(localStorage.getItem("user" ) || "{}");
|
|
48
|
-
const userId = user.id;
|
|
49
|
-
|
|
50
|
-
const requestObj = {
|
|
51
|
-
fromUser: `/users/${userId}`,
|
|
52
|
-
property: `/properties/${id}`,
|
|
53
|
-
text: messageText,
|
|
54
|
-
firstName,
|
|
55
|
-
lastName,
|
|
56
|
-
theme: `/themes/${themeId}`,
|
|
57
|
-
subject: subject,
|
|
58
|
-
};
|
|
33
|
+
function handleSendMessage() {
|
|
34
|
+
props.sendDataToParent(data);
|
|
59
35
|
};
|
|
36
|
+
|
|
60
37
|
useEffect(() => {
|
|
61
38
|
const user = JSON.parse(localStorage.getItem("user") || "{}");
|
|
62
39
|
if (user) {
|
|
@@ -47,15 +47,7 @@ interface PopupProps {
|
|
|
47
47
|
firstname: any;
|
|
48
48
|
lastname: any;
|
|
49
49
|
themesList: any;
|
|
50
|
-
|
|
51
|
-
fromUser: string;
|
|
52
|
-
property: string;
|
|
53
|
-
text: string;
|
|
54
|
-
firstName: string;
|
|
55
|
-
lastName: string;
|
|
56
|
-
theme: string;
|
|
57
|
-
subject: string;
|
|
58
|
-
};
|
|
50
|
+
handleDataFromChild: any;
|
|
59
51
|
}
|
|
60
52
|
export default function PropertyCard(props: PopupProps) {
|
|
61
53
|
const [liked, setLiked] = useState(false);
|
|
@@ -65,6 +57,7 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
65
57
|
const [floorPlan, setFloorPlan] = useState(false);
|
|
66
58
|
const [messagePopUp, setMessagPopUp] = useState(false);
|
|
67
59
|
const [sharePopUp, setSharePopUp] = useState(false);
|
|
60
|
+
const [dataFromChild, setDataFromChild] = useState("");
|
|
68
61
|
|
|
69
62
|
const pictureUrls =
|
|
70
63
|
props.property?.pictures?.length > 0
|
|
@@ -95,7 +88,9 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
95
88
|
const messagePopupClose = () =>{
|
|
96
89
|
setMessagPopUp(false);
|
|
97
90
|
}
|
|
98
|
-
|
|
91
|
+
function handleDataFromChild(data: any) {
|
|
92
|
+
setDataFromChild(data);
|
|
93
|
+
}
|
|
99
94
|
const handleArrowClickInMainImage = (direction: string) => {
|
|
100
95
|
if (!props.property || pictureUrls.length === 0) return;
|
|
101
96
|
|
|
@@ -294,7 +289,7 @@ export default function PropertyCard(props: PopupProps) {
|
|
|
294
289
|
firstname={props.firstname}
|
|
295
290
|
lastname={props.lastname}
|
|
296
291
|
themesList={props.themesList}
|
|
297
|
-
|
|
292
|
+
sendDataToParent={handleDataFromChild}
|
|
298
293
|
/>
|
|
299
294
|
)}
|
|
300
295
|
{sharePopUp && <SharePopup onClick={() => setSharePopUp(false)} />}
|