can edit text + fix font weight - remove character space
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import Button from "@/components/Button";
|
||||
import Input from "@/components/Input";
|
||||
import ColorPicker from "@/components/ColorPicker";
|
||||
import type { EditorObject } from "@/pages/editor/store/editorStore";
|
||||
|
||||
type ShapeSettingsProps = {
|
||||
@@ -21,7 +22,7 @@ const ShapeSettings = ({ selectedObject, onUpdate }: ShapeSettingsProps) => {
|
||||
const baseHeight = selectedObject.height ?? 100;
|
||||
const baseFill = selectedObject.fill ?? "#3b82f6";
|
||||
const baseStroke = selectedObject.stroke ?? "#1e40af";
|
||||
const baseStrokeWidth = selectedObject.strokeWidth ?? 2;
|
||||
const baseStrokeWidth = selectedObject.strokeWidth ?? 0;
|
||||
|
||||
const [formState, setFormState] = useState<ShapeFormState>({
|
||||
width: String(baseWidth),
|
||||
@@ -87,25 +88,23 @@ const ShapeSettings = ({ selectedObject, onUpdate }: ShapeSettingsProps) => {
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<Input
|
||||
<ColorPicker
|
||||
label="رنگ پسزمینه"
|
||||
type="color"
|
||||
value={formState.fill}
|
||||
onChange={(e) =>
|
||||
onChange={(value) =>
|
||||
setFormState((prev) => ({
|
||||
...prev,
|
||||
fill: e.target.value,
|
||||
fill: value,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<Input
|
||||
<ColorPicker
|
||||
label="رنگ خط"
|
||||
type="color"
|
||||
value={formState.stroke}
|
||||
onChange={(e) =>
|
||||
onChange={(value) =>
|
||||
setFormState((prev) => ({
|
||||
...prev,
|
||||
stroke: e.target.value,
|
||||
stroke: value,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
@@ -119,7 +118,7 @@ const ShapeSettings = ({ selectedObject, onUpdate }: ShapeSettingsProps) => {
|
||||
strokeWidth: e.target.value,
|
||||
}))
|
||||
}
|
||||
min={1}
|
||||
min={0}
|
||||
/>
|
||||
<Button type="button" onClick={handleSave} disabled={!isDirty} className="w-full">
|
||||
ذخیره تغییرات
|
||||
|
||||
Reference in New Issue
Block a user