nestiq-component-library 1.1.55 → 1.1.57

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.
@@ -9,10 +9,9 @@ import moreIcon from "../../assets/Images/more.svg";
9
9
  import arrowLeft from "../../assets/Images/card-arrow-left.svg";
10
10
  import arrowRight from "../../assets/Images/card-arrow-right.svg";
11
11
  import iconLayers from "../../assets/Images/layer_icon.svg";
12
- import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
12
+ import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
13
13
  import MessagePopUp from "../MessagePopup/MessagePopUp";
14
- import SharePopup from "../SharePopup/SharePopup";
15
-
14
+ import SharePopup from "../SharePopup/SharePopup";
16
15
 
17
16
  interface PopupProps {
18
17
  property: {
@@ -47,7 +46,7 @@ interface PopupProps {
47
46
  firstname: any;
48
47
  lastname: any;
49
48
  themesList: any;
50
- handleDataFromChild: any;
49
+ sendData: any;
51
50
  }
52
51
  export default function PropertyCard(props: PopupProps) {
53
52
  const [liked, setLiked] = useState(false);
@@ -57,7 +56,11 @@ export default function PropertyCard(props: PopupProps) {
57
56
  const [floorPlan, setFloorPlan] = useState(false);
58
57
  const [messagePopUp, setMessagPopUp] = useState(false);
59
58
  const [sharePopUp, setSharePopUp] = useState(false);
60
- const [dataFromChild, setDataFromChild] = useState("");
59
+ const [themeId, setThemeId] = useState("");
60
+ const [subject, setSubject] = useState("");
61
+ const [messageText, setMessageText] = useState("");
62
+ const [firstName, setFirstName] = useState("");
63
+ const [lastName, setLastName] = useState("");
61
64
 
62
65
  const pictureUrls =
63
66
  props.property?.pictures?.length > 0
@@ -81,16 +84,30 @@ export default function PropertyCard(props: PopupProps) {
81
84
  setSharePopUp(true);
82
85
  console.log("sharePopUp", sharePopUp);
83
86
  };
84
- const handleClosePopup = () =>{
87
+ const handleClosePopup = () => {
85
88
  setFloorPlan(false);
86
89
  setMessagPopUp(false);
87
- }
88
- const messagePopupClose = () =>{
90
+ };
91
+ const messagePopupClose = () => {
89
92
  setMessagPopUp(false);
93
+ };
94
+ function handleDataFromChild(
95
+ firstName: string,
96
+ lastName: string,
97
+ themeId: string,
98
+ subject: string,
99
+ messageText: string
100
+ ) {
101
+ setFirstName(firstName);
102
+ setLastName(lastName);
103
+ setThemeId(themeId);
104
+ setSubject(subject);
105
+ setMessageText(messageText);
106
+ }
107
+ function handleSendMessage() {
108
+ props.sendData(themeId, subject, messageText, firstName, lastName);
90
109
  }
91
- function handleDataFromChild(data: any) {
92
- setDataFromChild(data);
93
- }
110
+
94
111
  const handleArrowClickInMainImage = (direction: string) => {
95
112
  if (!props.property || pictureUrls.length === 0) return;
96
113