From 3e99fa431bd85ae894049ddfcc28e05f63dd429d Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 20 Jul 2023 18:09:46 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(floatComponent):=20replace?= =?UTF-8?q?=20input=20element=20with=20custom=20Input=20component=20for=20?= =?UTF-8?q?consistency=20and=20reusability=20=F0=9F=94=A7=20fix(inputCompo?= =?UTF-8?q?nent):=20replace=20input=20element=20with=20custom=20Input=20co?= =?UTF-8?q?mponent=20for=20consistency=20and=20reusability=20=F0=9F=94=A7?= =?UTF-8?q?=20fix(inputListComponent):=20replace=20input=20element=20with?= =?UTF-8?q?=20custom=20Input=20component=20for=20consistency=20and=20reusa?= =?UTF-8?q?bility=20=F0=9F=94=A7=20fix(intComponent):=20replace=20input=20?= =?UTF-8?q?element=20with=20custom=20Input=20component=20for=20consistency?= =?UTF-8?q?=20and=20reusability=20=F0=9F=94=A7=20fix(textAreaComponent):?= =?UTF-8?q?=20replace=20input=20element=20with=20custom=20Input=20componen?= =?UTF-8?q?t=20for=20consistency=20and=20reusability=20=F0=9F=94=A7=20fix(?= =?UTF-8?q?ui/input):=20update=20Input=20component=20styles=20to=20match?= =?UTF-8?q?=20the=20design=20requirements=20=F0=9F=94=A7=20fix(index.css):?= =?UTF-8?q?=20update=20styles=20for=20Input=20component=20to=20match=20the?= =?UTF-8?q?=20design=20requirements=20=F0=9F=94=A7=20fix(extraSidebarCompo?= =?UTF-8?q?nent):=20replace=20input=20element=20with=20custom=20Input=20co?= =?UTF-8?q?mponent=20for=20consistency=20and=20reusability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/floatComponent/index.tsx | 11 +++++------ .../src/components/inputComponent/index.tsx | 12 ++++++------ .../src/components/inputListComponent/index.tsx | 17 +++++++---------- .../src/components/intComponent/index.tsx | 17 +++++++---------- .../src/components/textAreaComponent/index.tsx | 11 +++++------ src/frontend/src/components/ui/input.tsx | 2 +- src/frontend/src/index.css | 10 ++++------ .../components/extraSidebarComponent/index.tsx | 3 ++- 8 files changed, 37 insertions(+), 46 deletions(-) diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index 278b3d203..a3d29b798 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import { FloatComponentType } from "../../types/components"; +import { Input } from "../ui/input"; export default function FloatComponent({ value, @@ -19,8 +20,8 @@ export default function FloatComponent({ }, [disabled, onChange]); return ( -
- + - + { diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index a54b4151f..8fde7cf4c 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -3,6 +3,7 @@ import { InputListComponentType } from "../../types/components"; import _ from "lodash"; import IconComponent from "../genericIconComponent"; +import { Input } from "../ui/input"; export default function InputListComponent({ value, @@ -27,23 +28,19 @@ export default function InputListComponent({ }, [disabled, onChange]); return ( -
{inputList.map((i, idx) => { return (
- { diff --git a/src/frontend/src/components/intComponent/index.tsx b/src/frontend/src/components/intComponent/index.tsx index 24d28e4f5..8a4da22b6 100644 --- a/src/frontend/src/components/intComponent/index.tsx +++ b/src/frontend/src/components/intComponent/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import { FloatComponentType } from "../../types/components"; +import { Input } from "../ui/input"; export default function IntComponent({ value, @@ -17,13 +18,9 @@ export default function IntComponent({ }, [disabled, onChange]); return ( -
- { if ( event.key !== "Backspace" && @@ -52,11 +49,11 @@ export default function IntComponent({ }} value={value ?? ""} className={ - "nopan nodrag noundo nocopy " + - (editNode - ? " input-edit-node " - : " input-primary " + (disabled ? " input-disable" : "")) + editNode + ? "input-edit-node" + : "" } + disabled={disabled} placeholder={editNode ? "Integer number" : "Type an integer number"} onChange={(e) => { onChange(e.target.value); diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index 2bead9a2d..e3cbb672f 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -3,6 +3,7 @@ import { TypeModal } from "../../constants/enums"; import GenericModal from "../../modals/genericModal"; import { TextAreaComponentType } from "../../types/components"; import IconComponent from "../genericIconComponent"; +import { Input } from "../ui/input"; export default function TextAreaComponent({ value, @@ -18,15 +19,14 @@ export default function TextAreaComponent({ }, [disabled]); return ( -
- { @@ -55,6 +55,5 @@ export default function TextAreaComponent({
-
); } diff --git a/src/frontend/src/components/ui/input.tsx b/src/frontend/src/components/ui/input.tsx index 0942a3930..33b7f8813 100644 --- a/src/frontend/src/components/ui/input.tsx +++ b/src/frontend/src/components/ui/input.tsx @@ -10,7 +10,7 @@ const Input = React.forwardRef(
-