This commit is contained in:
@@ -5,7 +5,7 @@ import { useSharedStore } from "@/shared/store/sharedStore";
|
||||
import { CloseSquare } from "iconsax-react";
|
||||
import { useEditorStore, type ToolType } from "../store/editorStore";
|
||||
import { useObjectHandlers } from "./canvas/useObjectHandlers";
|
||||
import { ToolsBar, ObjectSettings, ToolInstructions } from "./sidebar";
|
||||
import { ObjectSettings, ToolInstructions, ToolsBar } from "./sidebar";
|
||||
|
||||
type EditorSidebarProps = {
|
||||
catalogSize?: string;
|
||||
@@ -13,11 +13,14 @@ type EditorSidebarProps = {
|
||||
|
||||
const EditorSidebar = ({ catalogSize }: EditorSidebarProps) => {
|
||||
const { openSidebar, setOpenSidebar } = useSharedStore();
|
||||
const { tool, setTool, selectedObjectId, objects, deleteObject } = useEditorStore();
|
||||
const { tool, setTool, selectedObjectId, objects, deleteObject } =
|
||||
useEditorStore();
|
||||
const { handleObjectUpdate } = useObjectHandlers();
|
||||
|
||||
const selectedObject = objects.find((obj) => obj.id === selectedObjectId);
|
||||
const { width: pageWidth, height: pageHeight } = getPaperDimensions(catalogSize ?? "a4");
|
||||
const { width: pageWidth, height: pageHeight } = getPaperDimensions(
|
||||
catalogSize ?? "a4",
|
||||
);
|
||||
|
||||
const handleToolClick = (selectedTool: ToolType) => {
|
||||
setTool(selectedTool);
|
||||
@@ -36,11 +39,13 @@ const EditorSidebar = ({ catalogSize }: EditorSidebarProps) => {
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{openSidebar ? (
|
||||
<div className="fixed inset-0 z-10 bg-black/50" onClick={() => setOpenSidebar(false)} />
|
||||
<div
|
||||
className="fixed inset-0 z-10 bg-black/50"
|
||||
onClick={() => setOpenSidebar(false)}
|
||||
/>
|
||||
) : null}
|
||||
<aside
|
||||
className={clx(
|
||||
@@ -49,7 +54,7 @@ const EditorSidebar = ({ catalogSize }: EditorSidebarProps) => {
|
||||
)}
|
||||
>
|
||||
<div className="mb-10 flex items-center justify-between">
|
||||
<img src={Logo} alt="لوگو دانک" className="h-9 mx-auto pr-3" />
|
||||
<img src={Logo} alt="لوگو دانک" className="h-5 mx-auto pr-3" />
|
||||
<div className="flex items-center gap-2">
|
||||
{/* <button
|
||||
onClick={handleLoadJSON}
|
||||
|
||||
Reference in New Issue
Block a user