parent
d91f403c8d
commit
75418ebc52
|
@ -63,36 +63,6 @@ const AddressInput = ({
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
</OnChange>
|
</OnChange>
|
||||||
{/* onBlur - didn't work because of the complex validation
|
|
||||||
(if you submit before it gets the address, breaks everything) */}
|
|
||||||
{/* <Field
|
|
||||||
name={name}
|
|
||||||
subscription={{ active: true, value: true }}
|
|
||||||
render={({ meta, input }) => {
|
|
||||||
const [prevActive, setPrevActive] = useState<boolean>(!!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
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import OpenPaper from '~/components/Stepper/OpenPaper'
|
||||||
import AddressInput from '~/components/forms/AddressInput'
|
import AddressInput from '~/components/forms/AddressInput'
|
||||||
import Field from '~/components/forms/Field'
|
import Field from '~/components/forms/Field'
|
||||||
import TextField from '~/components/forms/TextField'
|
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 Block from '~/components/layout/Block'
|
||||||
import Paragraph from '~/components/layout/Paragraph'
|
import Paragraph from '~/components/layout/Paragraph'
|
||||||
import { SAFE_MASTER_COPY_ADDRESS_V10, getSafeMasterContract, validateProxy } from '~/logic/contracts/safeContracts'
|
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*"
|
placeholder="Safe Address*"
|
||||||
text="Safe Address"
|
text="Safe Address"
|
||||||
type="text"
|
type="text"
|
||||||
validate={composeValidators(required, mustBeEthereumAddress)}
|
|
||||||
/>
|
/>
|
||||||
</Block>
|
</Block>
|
||||||
<Block margin="sm">
|
<Block margin="sm">
|
||||||
|
|
Loading…
Reference in New Issue