nestiq-component-library 1.1.157 → 1.1.159

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.
@@ -47,6 +47,9 @@ interface PopupProps {
47
47
  onclickSuccess: () => void;
48
48
  onClick: () => void;
49
49
  onFloorPlanClick: () => void;
50
+ options?: {
51
+ override_share_link?: string;
52
+ };
50
53
  }
51
54
  export default function PropertyCard(props: PopupProps) {
52
55
  const [liked, setLiked] = useState(false);
@@ -77,13 +80,13 @@ export default function PropertyCard(props: PopupProps) {
77
80
  };
78
81
  const handleSharePopUp = () => {
79
82
  setSharePopUp(true);
80
- const path = document.querySelector(
81
- "#root > div:nth-child(3) > div:nth-child(3) > div.d-flex.px-lg-5.px-md-3.flex-column.col-12.filter-section-wrapper.mx-auto.mt-3 > div.mt-2.d-flex.flex-column.gap-4 > div:nth-child(1) > div:nth-child(3) > div > div > div.col-10.mx-auto > div > input"
82
- );
83
- console.log(path);
84
- if (path) {
85
- path.innerHTML = window.location.href + props.property.id;
86
- }
83
+ // const path = document.querySelector(
84
+ // "#root > div:nth-child(3) > div:nth-child(3) > div.d-flex.px-lg-5.px-md-3.flex-column.col-12.filter-section-wrapper.mx-auto.mt-3 > div.mt-2.d-flex.flex-column.gap-4 > div:nth-child(1) > div:nth-child(3) > div > div > div.col-10.mx-auto > div > input"
85
+ // );
86
+ // console.log(path);
87
+ // if (path) {
88
+ // path.innerHTML = window.location.href + props.property.id;
89
+ // }
87
90
  };
88
91
 
89
92
  const handleArrowClickInMainImage = (direction: string) => {
@@ -346,7 +349,14 @@ export default function PropertyCard(props: PopupProps) {
346
349
  </div>
347
350
  )}
348
351
  </div>
349
- {sharePopUp && <SharePopup onClick={() => setSharePopUp(false)} />}
352
+ {sharePopUp && (
353
+ <SharePopup
354
+ options={{
355
+ override_location: props?.options?.override_share_link,
356
+ }}
357
+ onClick={() => setSharePopUp(false)}
358
+ />
359
+ )}
350
360
  </div>
351
361
  );
352
362
  }
@@ -11,6 +11,9 @@ import "../../styles/common.css";
11
11
 
12
12
  interface PopupProps {
13
13
  onClick: String | any;
14
+ options?: {
15
+ override_location: string | any;
16
+ };
14
17
  }
15
18
  export default function SharePopup(props: PopupProps) {
16
19
  const [showPopUp, setShowPopUp] = useState(true);
@@ -18,7 +21,7 @@ export default function SharePopup(props: PopupProps) {
18
21
  const handleClose = () => {
19
22
  props.onClick();
20
23
  };
21
-
24
+
22
25
  const urlInputRef = useRef<HTMLInputElement | null>(null);
23
26
 
24
27
  const copyToClipboard = () => {
@@ -122,7 +125,9 @@ export default function SharePopup(props: PopupProps) {
122
125
  type="text"
123
126
  className="popup_search-input rounded-4 border border-0 "
124
127
  placeholder="Enter link here"
125
- value={window.location.href}
128
+ value={
129
+ props?.options?.override_location || window.location.href
130
+ }
126
131
  readOnly
127
132
  />
128
133
  <button