can shape edit + when add shape is default selected
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useEditorStore, type ToolType } from "../../store/editorStore";
|
||||
import { useEditorStore, type ToolType } from "@/pages/editor/store/editorStore";
|
||||
import {
|
||||
ImageUpload,
|
||||
DocumentUpload,
|
||||
@@ -19,7 +19,7 @@ type ToolInstructionsProps = {
|
||||
};
|
||||
|
||||
const ToolInstructions = ({ tool }: ToolInstructionsProps) => {
|
||||
const { addObject } = useEditorStore();
|
||||
const { addObject, setSelectedObjectId, setTool } = useEditorStore();
|
||||
|
||||
const handleImageUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
@@ -39,6 +39,8 @@ const ToolInstructions = ({ tool }: ToolInstructionsProps) => {
|
||||
imageUrl,
|
||||
};
|
||||
addObject(newImage);
|
||||
setSelectedObjectId(newImage.id);
|
||||
setTool("select");
|
||||
};
|
||||
img.src = imageUrl;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user