Skip to content

Commit 7f61ee0

Browse files
committed
feat: pin deselection while map is clicked
1 parent 9e95458 commit 7f61ee0

File tree

1 file changed

+13
-2
lines changed
  • vis/js/templates/Geomap/HeightContainer

1 file changed

+13
-2
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import { FC, PropsWithChildren } from "react";
2-
import { useSelector } from "react-redux";
2+
import { useDispatch, useSelector } from "react-redux";
3+
4+
import { deselectPaper } from "@/js/actions";
35

46
import { getMapHeight } from "./selectors";
57

68
export const HeightContainer: FC<PropsWithChildren> = ({ children }) => {
79
const height = useSelector(getMapHeight);
10+
const dispatch = useDispatch();
11+
12+
const handleMapClick = () => {
13+
dispatch(deselectPaper());
14+
};
815

9-
return <div style={{ height }}>{children}</div>;
16+
return (
17+
<div style={{ height }} onClick={handleMapClick}>
18+
{children}
19+
</div>
20+
);
1021
};

0 commit comments

Comments
 (0)