datastake-daf 0.6.243 → 0.6.244

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.243",
3
+ "version": "0.6.244",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -63,6 +63,7 @@ export function useMapHelper({
63
63
 
64
64
  // Actions to do when active marker is changed
65
65
  useEffect(() => {
66
+ console.log("RERENDER");
66
67
  if (mapRef) {
67
68
  if (activeMarker) {
68
69
  mapRef.eachLayer((layer) => {
@@ -285,7 +285,6 @@ export const useMap = ({
285
285
  if (mapRef) {
286
286
  if (type === "chain") {
287
287
  mapRef.on("zoomend", handleZoomChange);
288
- mapRef.on("movestart", destroyAllPopovers);
289
288
  }
290
289
  }
291
290
 
@@ -293,11 +292,10 @@ export const useMap = ({
293
292
  if (mapRef) {
294
293
  if (type === "chain") {
295
294
  mapRef.off("zoomend", handleZoomChange);
296
- mapRef.off("movestart", destroyAllPopovers);
297
295
  }
298
296
  }
299
297
  };
300
- }, [mapRef, markerWithPopup]);
298
+ }, [mapRef, markerWithPopup, type]);
301
299
 
302
300
  useEffect(() => {
303
301
  if (mapRef) {
@@ -35,12 +35,12 @@ export default function SDGWidget({
35
35
 
36
36
  const SDGContainer = styled.div`
37
37
  display: grid;
38
- grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
38
+ grid-template-columns: repeat(auto-fit, minmax(53px, 1fr));
39
39
  gap: 8px;
40
40
 
41
41
  .sdg-item {
42
- height: 90px;
43
- width: 90px;
42
+ height: 53px;
43
+ width: 53px;
44
44
  border-radius: 8px;
45
45
  background-size: cover;
46
46
  background-position: center;
@@ -0,0 +1,93 @@
1
+ import CustomIcon from "../../../Icon/CustomIcon.jsx";
2
+ import { theme } from "antd";
3
+ import { useState } from "react";
4
+ import Widget from "../../../Dashboard/Widget/index.jsx";
5
+ const { useToken } = theme;
6
+ export default function Smart() {
7
+ const { token } = useToken();
8
+ const [isOpen, setIsOpen] = useState(false);
9
+ return (
10
+ <div
11
+ style={{
12
+ border: "1px solid #E5E7EB",
13
+ width: "100%",
14
+ borderRadius: "4px",
15
+ boxShadow:
16
+ "0px 1px 2px 0px #00000008, 0px 1px 6px -1px #00000005, 0px 2px 4px 0px #00000005",
17
+ }}
18
+ >
19
+ <div
20
+ style={{
21
+ display: "flex",
22
+ alignItems: "center",
23
+ gap: "8px",
24
+ padding: "8px",
25
+ }}
26
+ onClick={() => setIsOpen(!isOpen)}
27
+ >
28
+ <CustomIcon name="Lightning" size={16} color={token.colorPrimary7} />
29
+ <span style={{ marginRight: "auto" }}>Smart Help</span>
30
+ <div>
31
+ <CustomIcon
32
+ name="ChevronRight"
33
+ size={12}
34
+ color={token.colorPrimary7}
35
+ style={{
36
+ transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
37
+ transition: "transform 0.3s ease-in-out",
38
+ }}
39
+ />
40
+ </div>
41
+ </div>
42
+ {isOpen && (
43
+ <div
44
+ style={{
45
+ padding: "8px",
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ gap: "12px",
49
+ }}
50
+ >
51
+ <span
52
+ style={{
53
+ paddingLeft: "4px",
54
+ color: "#6C737F",
55
+ fontFamily: "SF UI Display",
56
+ fontWeight: "500",
57
+ fontStyle: "Medium",
58
+ fontSize: "14px",
59
+ leadingTrim: "NONE",
60
+ lineHeight: "20px",
61
+ letterSpacing: "0%",
62
+ }}
63
+ >
64
+ The information available here has been identified as matching the
65
+ requirements of this question.
66
+ </span>
67
+ <SmartWidget label="Operational Activities" icon="AimOutlined" link="Link" />
68
+ <SmartWidget label="Monitoring Activities" icon="Eye" link="Link" />
69
+ <SmartWidget label="Project Locations" icon="DashboardLocations" link="Link" />
70
+ <SmartWidget label="Documents & Media" icon="DashboardDocuments" link="Link" />
71
+ </div>
72
+ )}
73
+ </div>
74
+ );
75
+ }
76
+
77
+ function SmartWidget({ label, icon, link }) {
78
+ const { token } = useToken();
79
+ return (
80
+ <Widget noTitle className={"no-p-body p-xs"}>
81
+ <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
82
+ <CustomIcon name={icon} size={16} color={"#384250"} />
83
+ <span style={{ marginRight: "auto" }}>{label}</span>
84
+ <CustomIcon
85
+ name={link}
86
+ size={16}
87
+ color={token.baseGray50}
88
+ style={{ cursor: "not-allowed" }}
89
+ />
90
+ </div>
91
+ </Widget>
92
+ );
93
+ }