From f40f0bdf3288a94d6d65b8ac62ff877a58f35440 Mon Sep 17 00:00:00 2001 From: Siklos Date: Thu, 11 Aug 2022 17:47:04 +0200 Subject: [PATCH] Improve form input --- src/Components/Properties/Properties.tsx | 44 ++++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/Components/Properties/Properties.tsx b/src/Components/Properties/Properties.tsx index 3720188..49f5028 100644 --- a/src/Components/Properties/Properties.tsx +++ b/src/Components/Properties/Properties.tsx @@ -22,15 +22,17 @@ export const Properties: React.FC = (props: IPropertiesProps) .forEach((pair) => handleProperties(pair, groupInput, isDynamicInput, props.onChange)); const form = isDynamicInput - ?
+ ?
{ groupInput }
:
props.onSubmit(event, props.properties as ContainerProperties)} > - - { groupInput } + +
+ { groupInput } +
; @@ -67,16 +69,19 @@ const handleProperties = ( type = INPUT_TYPES[key]; } + const className = ` + w-full + text-xs font-medium transition-all text-gray-800 mt-1 px-3 py-2 + bg-white border-2 border-white rounded-lg placeholder-gray-800 + focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 + disabled:bg-slate-300 disabled:text-gray-500 disabled:border-slate-300 disabled:shadow-none`; const isDisabled = ['id', 'parentId'].includes(key); const input = isDynamicInput ? { @@ -89,22 +94,23 @@ const handleProperties = ( disabled={isDisabled} /> : ; groupInput.push( -
- - {input} -
+ ); + groupInput.push(input); };