From 3e99fa431bd85ae894049ddfcc28e05f63dd429d Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 20 Jul 2023 18:09:46 -0300 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=A7=20fix(floatComponent):=20repla?= =?UTF-8?q?ce=20input=20element=20with=20custom=20Input=20component=20for?= =?UTF-8?q?=20consistency=20and=20reusability=20=F0=9F=94=A7=20fix(inputCo?= =?UTF-8?q?mponent):=20replace=20input=20element=20with=20custom=20Input?= =?UTF-8?q?=20component=20for=20consistency=20and=20reusability=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(inputListComponent):=20replace=20input=20ele?= =?UTF-8?q?ment=20with=20custom=20Input=20component=20for=20consistency=20?= =?UTF-8?q?and=20reusability=20=F0=9F=94=A7=20fix(intComponent):=20replace?= =?UTF-8?q?=20input=20element=20with=20custom=20Input=20component=20for=20?= =?UTF-8?q?consistency=20and=20reusability=20=F0=9F=94=A7=20fix(textAreaCo?= =?UTF-8?q?mponent):=20replace=20input=20element=20with=20custom=20Input?= =?UTF-8?q?=20component=20for=20consistency=20and=20reusability=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(ui/input):=20update=20Input=20component=20st?= =?UTF-8?q?yles=20to=20match=20the=20design=20requirements=20=F0=9F=94=A7?= =?UTF-8?q?=20fix(index.css):=20update=20styles=20for=20Input=20component?= =?UTF-8?q?=20to=20match=20the=20design=20requirements=20=F0=9F=94=A7=20fi?= =?UTF-8?q?x(extraSidebarComponent):=20replace=20input=20element=20with=20?= =?UTF-8?q?custom=20Input=20component=20for=20consistency=20and=20reusabil?= =?UTF-8?q?ity?= 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(
- Date: Thu, 20 Jul 2023 18:40:24 -0300 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A7=20chore(textarea.tsx):=20refac?= =?UTF-8?q?tor=20textarea=20component=20class=20names=20for=20improved=20r?= =?UTF-8?q?eadability=20and=20maintainability=20=F0=9F=94=A7=20chore(index?= =?UTF-8?q?.css):=20refactor=20input-primary=20class=20to=20remove=20unnec?= =?UTF-8?q?essary=20styles=20and=20improve=20readability=20=F0=9F=94=A7=20?= =?UTF-8?q?chore(index.css):=20add=20new=20textarea-primary=20class=20for?= =?UTF-8?q?=20textarea=20component=20with=20similar=20styles=20as=20input-?= =?UTF-8?q?primary=20but=20without=20truncation=20=F0=9F=94=A7=20chore(cha?= =?UTF-8?q?tInput/index.tsx):=20replace=20textarea=20element=20with=20Text?= =?UTF-8?q?area=20component=20for=20consistency=20and=20reusability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/ui/textarea.tsx | 2 +- src/frontend/src/index.css | 10 +++++++--- src/frontend/src/modals/formModal/chatInput/index.tsx | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/components/ui/textarea.tsx b/src/frontend/src/components/ui/textarea.tsx index 64aec41a1..2dcafa1f9 100644 --- a/src/frontend/src/components/ui/textarea.tsx +++ b/src/frontend/src/components/ui/textarea.tsx @@ -9,7 +9,7 @@ const Textarea = React.forwardRef( return (