From ebcc316aa21dc737653250c397ac5a160d30da26 Mon Sep 17 00:00:00 2001 From: KY Lau Date: Thu, 10 Jun 2021 13:16:34 +0800 Subject: [PATCH] Fix complexity issue --- src/components/molecules/FormFields/Credential/index.tsx | 8 +++----- .../organisms/AssetActions/Edit/EditAdvanceSettings.tsx | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/molecules/FormFields/Credential/index.tsx b/src/components/molecules/FormFields/Credential/index.tsx index 8906e1b19..17612aaef 100644 --- a/src/components/molecules/FormFields/Credential/index.tsx +++ b/src/components/molecules/FormFields/Credential/index.tsx @@ -17,10 +17,6 @@ export default function Credential(props: InputProps) { helpers.setValue(arrayInput) }, [arrayInput]) - function handleChange(e: ChangeEvent) { - setValue(e.target.value) - } - function handleDeleteChip(value: string) { const newInput = arrayInput.filter((input) => input !== value) setArrayInput(newInput) @@ -48,7 +44,9 @@ export default function Credential(props: InputProps) { className={styles.input} placeholder={props.placeholder} name="search" - onChange={handleChange} + onChange={(e: ChangeEvent) => + setValue(e.target.value) + } value={value} />