feat: zoom tool

This commit is contained in:
trafficlunar 2024-12-15 13:46:28 +00:00
parent ceb87c2088
commit 57064e71c7
3 changed files with 67 additions and 19 deletions

View file

@ -19,7 +19,18 @@ export const ToolProvider = ({ children }: Props) => {
const [cssCursor, setCssCursor] = useState("pointer");
useEffect(() => {
setCssCursor(tool === "hand" ? "grab" : "pointer");
switch (tool) {
case "hand":
setCssCursor("grab");
break;
case "zoom":
setCssCursor("zoom-in");
break;
default:
setCssCursor("pointer");
break;
}
}, [tool]);
return <ToolContext.Provider value={{ tool, selectedBlock, cssCursor, setTool, setSelectedBlock, setCssCursor }}>{children}</ToolContext.Provider>;