From c6d1097a30bd9d3213f7b399790c879b78dcd766 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sun, 14 Jun 2026 12:30:24 +0330 Subject: [PATCH] move custum shape to shapes --- .../editor/components/sidebar/ToolInstructions.tsx | 3 +-- src/pages/editor/components/sidebar/ToolsBar.tsx | 4 +--- .../sidebar/instructions/RectangleInstruction.tsx | 10 +++++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/editor/components/sidebar/ToolInstructions.tsx b/src/pages/editor/components/sidebar/ToolInstructions.tsx index 3213984..8d54afb 100644 --- a/src/pages/editor/components/sidebar/ToolInstructions.tsx +++ b/src/pages/editor/components/sidebar/ToolInstructions.tsx @@ -9,7 +9,6 @@ import { TextInstruction, StickerInstruction, GridInstruction, - CustomShapeInstruction, } from "./instructions"; type ToolInstructionsProps = { @@ -38,10 +37,10 @@ const ToolInstructions = ({ tool }: ToolInstructionsProps) => { rectangle: , line: , arrow: , + "custom-shape": , text: , sticker: , grid: , - "custom-shape": , }; return simpleInstructions[tool] ?? null; diff --git a/src/pages/editor/components/sidebar/ToolsBar.tsx b/src/pages/editor/components/sidebar/ToolsBar.tsx index cf2d716..3695e5e 100644 --- a/src/pages/editor/components/sidebar/ToolsBar.tsx +++ b/src/pages/editor/components/sidebar/ToolsBar.tsx @@ -9,7 +9,6 @@ import { VideoSquare, Music, Link2, - Magicpen, } from "iconsax-react"; import type { ToolType } from "../../store/editorStore"; @@ -23,7 +22,6 @@ const tools: Array<{ icon: (color: string, variant?: "Bold" | "Outline" | "Broke { icon: (color, variant) => , tool: "video", label: "ویدیو" }, { icon: (color, variant) => , tool: "audio", label: "صدا" }, { icon: (color, variant) => , tool: "sticker", label: "استیکر" }, - { icon: (color, variant) => , tool: "custom-shape", label: "شکل سفارشی" }, ]; type ToolsBarProps = { @@ -37,7 +35,7 @@ const ToolsBar = ({ tool, onToolClick }: ToolsBarProps) => { {tools.map((item, index) => { const isActive = item.tool === "rectangle" - ? tool === "rectangle" || tool === "line" || tool === "arrow" + ? tool === "rectangle" || tool === "line" || tool === "arrow" || tool === "custom-shape" : tool === item.tool; const iconColor = "black"; const iconVariant: "Bold" | "Outline" | "Broken" | "Bulk" | "Linear" | "TwoTone" | undefined = isActive ? "Bold" : "Outline"; diff --git a/src/pages/editor/components/sidebar/instructions/RectangleInstruction.tsx b/src/pages/editor/components/sidebar/instructions/RectangleInstruction.tsx index d648e0f..ec7a8c6 100644 --- a/src/pages/editor/components/sidebar/instructions/RectangleInstruction.tsx +++ b/src/pages/editor/components/sidebar/instructions/RectangleInstruction.tsx @@ -1,5 +1,6 @@ import { type FC } from "react"; -import { ArrowLeft, Minus } from "iconsax-react"; +import { ArrowLeft, Magicpen, Minus } from "iconsax-react"; +import CustomShapeInstruction from "./CustomShapeInstruction"; import SquareIcon from "@/assets/icons/square.svg"; import CircleIcon from "@/assets/icons/circle.svg"; import TriangleIcon from "@/assets/icons/triangle.svg"; @@ -19,6 +20,7 @@ const shapeOptions: Array<{ id: ShapeType; label: string; icon: string; alt: str const drawOptions = [ { tool: "line" as const, label: "خط", Icon: Minus }, { tool: "arrow" as const, label: "پیکان", Icon: ArrowLeft }, + { tool: "custom-shape" as const, label: "سفارشی", Icon: Magicpen }, ]; const RectangleInstruction: FC = () => { @@ -86,6 +88,12 @@ const RectangleInstruction: FC = () => { {tool === "line" ? "برای رسم خط، روی کانوس کلیک کرده و بکشید" : "برای رسم پیکان، روی کانوس کلیک کرده و بکشید"}

)} + + {tool === "custom-shape" && ( +
+ +
+ )} ); };