From 75418ebc520b1a0ad7254f9069147ba233dc0b46 Mon Sep 17 00:00:00 2001 From: apane Date: Thu, 23 Apr 2020 15:14:25 -0300 Subject: [PATCH] Removes unused code Fixs params props safe address form --- src/components/forms/AddressInput/index.jsx | 30 ------------------- .../load/components/DetailsForm/index.jsx | 3 +- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/components/forms/AddressInput/index.jsx b/src/components/forms/AddressInput/index.jsx index e371de9a..b947cc67 100644 --- a/src/components/forms/AddressInput/index.jsx +++ b/src/components/forms/AddressInput/index.jsx @@ -63,36 +63,6 @@ const AddressInput = ({ } }} - {/* onBlur - didn't work because of the complex validation - (if you submit before it gets the address, breaks everything) */} - {/* { - const [prevActive, setPrevActive] = useState(!!meta.active) - - useEffect(() => { - async function setAddressFromENS() { - if (isValidEnsName(input.value)) { - try { - const resolverAddr = await getAddressFromENS(input.value) - fieldMutator(resolverAddr) - } catch (err) { - console.error('Error when trying to fetch address for ENS name: ', err) - } - } - } - - if (prevActive && !meta.active) { - setAddressFromENS() - } else if (prevActive !== meta.active) { - setPrevActive(meta.active) - } - }, [meta.active]) - - return null - }} - /> */} ) diff --git a/src/routes/load/components/DetailsForm/index.jsx b/src/routes/load/components/DetailsForm/index.jsx index 1d005ca8..266f131e 100644 --- a/src/routes/load/components/DetailsForm/index.jsx +++ b/src/routes/load/components/DetailsForm/index.jsx @@ -8,7 +8,7 @@ import OpenPaper from '~/components/Stepper/OpenPaper' import AddressInput from '~/components/forms/AddressInput' import Field from '~/components/forms/Field' import TextField from '~/components/forms/TextField' -import { composeValidators, mustBeEthereumAddress, noErrorsOn, required } from '~/components/forms/validator' +import { mustBeEthereumAddress, noErrorsOn, required } from '~/components/forms/validator' import Block from '~/components/layout/Block' import Paragraph from '~/components/layout/Paragraph' import { SAFE_MASTER_COPY_ADDRESS_V10, getSafeMasterContract, validateProxy } from '~/logic/contracts/safeContracts' @@ -120,7 +120,6 @@ const Details = ({ classes, errors, form }: Props) => ( placeholder="Safe Address*" text="Safe Address" type="text" - validate={composeValidators(required, mustBeEthereumAddress)} />