move custum shape to shapes
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
TextInstruction,
|
TextInstruction,
|
||||||
StickerInstruction,
|
StickerInstruction,
|
||||||
GridInstruction,
|
GridInstruction,
|
||||||
CustomShapeInstruction,
|
|
||||||
} from "./instructions";
|
} from "./instructions";
|
||||||
|
|
||||||
type ToolInstructionsProps = {
|
type ToolInstructionsProps = {
|
||||||
@@ -38,10 +37,10 @@ const ToolInstructions = ({ tool }: ToolInstructionsProps) => {
|
|||||||
rectangle: <RectangleInstruction />,
|
rectangle: <RectangleInstruction />,
|
||||||
line: <RectangleInstruction />,
|
line: <RectangleInstruction />,
|
||||||
arrow: <RectangleInstruction />,
|
arrow: <RectangleInstruction />,
|
||||||
|
"custom-shape": <RectangleInstruction />,
|
||||||
text: <TextInstruction />,
|
text: <TextInstruction />,
|
||||||
sticker: <StickerInstruction />,
|
sticker: <StickerInstruction />,
|
||||||
grid: <GridInstruction />,
|
grid: <GridInstruction />,
|
||||||
"custom-shape": <CustomShapeInstruction />,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return simpleInstructions[tool] ?? null;
|
return simpleInstructions[tool] ?? null;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
VideoSquare,
|
VideoSquare,
|
||||||
Music,
|
Music,
|
||||||
Link2,
|
Link2,
|
||||||
Magicpen,
|
|
||||||
} from "iconsax-react";
|
} from "iconsax-react";
|
||||||
import type { ToolType } from "../../store/editorStore";
|
import type { ToolType } from "../../store/editorStore";
|
||||||
|
|
||||||
@@ -23,7 +22,6 @@ const tools: Array<{ icon: (color: string, variant?: "Bold" | "Outline" | "Broke
|
|||||||
{ icon: (color, variant) => <VideoSquare size={20} color={color} variant={variant} />, tool: "video", label: "ویدیو" },
|
{ icon: (color, variant) => <VideoSquare size={20} color={color} variant={variant} />, tool: "video", label: "ویدیو" },
|
||||||
{ icon: (color, variant) => <Music size={20} color={color} variant={variant} />, tool: "audio", label: "صدا" },
|
{ icon: (color, variant) => <Music size={20} color={color} variant={variant} />, tool: "audio", label: "صدا" },
|
||||||
{ icon: (color, variant) => <Sticker size={20} color={color} variant={variant} />, tool: "sticker", label: "استیکر" },
|
{ icon: (color, variant) => <Sticker size={20} color={color} variant={variant} />, tool: "sticker", label: "استیکر" },
|
||||||
{ icon: (color, variant) => <Magicpen size={20} color={color} variant={variant} />, tool: "custom-shape", label: "شکل سفارشی" },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
type ToolsBarProps = {
|
type ToolsBarProps = {
|
||||||
@@ -37,7 +35,7 @@ const ToolsBar = ({ tool, onToolClick }: ToolsBarProps) => {
|
|||||||
{tools.map((item, index) => {
|
{tools.map((item, index) => {
|
||||||
const isActive =
|
const isActive =
|
||||||
item.tool === "rectangle"
|
item.tool === "rectangle"
|
||||||
? tool === "rectangle" || tool === "line" || tool === "arrow"
|
? tool === "rectangle" || tool === "line" || tool === "arrow" || tool === "custom-shape"
|
||||||
: tool === item.tool;
|
: tool === item.tool;
|
||||||
const iconColor = "black";
|
const iconColor = "black";
|
||||||
const iconVariant: "Bold" | "Outline" | "Broken" | "Bulk" | "Linear" | "TwoTone" | undefined = isActive ? "Bold" : "Outline";
|
const iconVariant: "Bold" | "Outline" | "Broken" | "Bulk" | "Linear" | "TwoTone" | undefined = isActive ? "Bold" : "Outline";
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { type FC } from "react";
|
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 SquareIcon from "@/assets/icons/square.svg";
|
||||||
import CircleIcon from "@/assets/icons/circle.svg";
|
import CircleIcon from "@/assets/icons/circle.svg";
|
||||||
import TriangleIcon from "@/assets/icons/triangle.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 = [
|
const drawOptions = [
|
||||||
{ tool: "line" as const, label: "خط", Icon: Minus },
|
{ tool: "line" as const, label: "خط", Icon: Minus },
|
||||||
{ tool: "arrow" as const, label: "پیکان", Icon: ArrowLeft },
|
{ tool: "arrow" as const, label: "پیکان", Icon: ArrowLeft },
|
||||||
|
{ tool: "custom-shape" as const, label: "سفارشی", Icon: Magicpen },
|
||||||
];
|
];
|
||||||
|
|
||||||
const RectangleInstruction: FC = () => {
|
const RectangleInstruction: FC = () => {
|
||||||
@@ -86,6 +88,12 @@ const RectangleInstruction: FC = () => {
|
|||||||
{tool === "line" ? "برای رسم خط، روی کانوس کلیک کرده و بکشید" : "برای رسم پیکان، روی کانوس کلیک کرده و بکشید"}
|
{tool === "line" ? "برای رسم خط، روی کانوس کلیک کرده و بکشید" : "برای رسم پیکان، روی کانوس کلیک کرده و بکشید"}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{tool === "custom-shape" && (
|
||||||
|
<div className="mt-9">
|
||||||
|
<CustomShapeInstruction />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user