mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-12 19:14:08 +00:00
update types
This commit is contained in:
parent
6d2638410f
commit
62270e180b
@ -14,6 +14,17 @@ import { getAddressBookListSelector } from 'src/logic/addressBook/store/selector
|
|||||||
import { getAddressFromENS } from 'src/logic/wallets/getWeb3'
|
import { getAddressFromENS } from 'src/logic/wallets/getWeb3'
|
||||||
import { isValidEnsName } from 'src/logic/wallets/ethAddresses'
|
import { isValidEnsName } from 'src/logic/wallets/ethAddresses'
|
||||||
|
|
||||||
|
export interface AddressBookProps {
|
||||||
|
classes: any
|
||||||
|
fieldMutator
|
||||||
|
isCustomTx: boolean
|
||||||
|
pristine: boolean
|
||||||
|
recipientAddress: string
|
||||||
|
setIsValidAddress: string
|
||||||
|
setSelectedEntry: string
|
||||||
|
onScannedValue: (scannedValue: string) => void
|
||||||
|
}
|
||||||
|
|
||||||
const textFieldLabelStyle = makeStyles(() => ({
|
const textFieldLabelStyle = makeStyles(() => ({
|
||||||
root: {
|
root: {
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
@ -30,13 +41,15 @@ const textFieldInputStyle = makeStyles(() => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const filterAddressBookWithContractAddresses = async (addressBook) => {
|
const filterAddressBookWithContractAddresses = async (addressBook: Array<any>): Promise<any> => {
|
||||||
const abFlags = await Promise.all(
|
const abFlags = await Promise.all(
|
||||||
addressBook.map(async ({ address }) => {
|
addressBook.map(
|
||||||
return (await mustBeEthereumContractAddress(address)) === undefined
|
async ({ address }: { address: string }): Promise<boolean> => {
|
||||||
}),
|
return (await mustBeEthereumContractAddress(address)) === undefined
|
||||||
|
},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return addressBook.filter((adbkEntry, index) => abFlags[index])
|
return addressBook.filter((_, index) => abFlags[index])
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddressBookInput = ({
|
const AddressBookInput = ({
|
||||||
@ -57,7 +70,7 @@ const AddressBookInput = ({
|
|||||||
|
|
||||||
const [inputAddValue, setInputAddValue] = useState(recipientAddress)
|
const [inputAddValue, setInputAddValue] = useState(recipientAddress)
|
||||||
|
|
||||||
const onAddressInputChanged = async (addressValue) => {
|
const onAddressInputChanged = async (addressValue: string): Promise<void> => {
|
||||||
setInputAddValue(addressValue)
|
setInputAddValue(addressValue)
|
||||||
let resolvedAddress = addressValue
|
let resolvedAddress = addressValue
|
||||||
let isValidText
|
let isValidText
|
||||||
@ -96,7 +109,7 @@ const AddressBookInput = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const filterAdbkContractAddresses = async () => {
|
const filterAdbkContractAddresses = async (): Promise<void> => {
|
||||||
if (!isCustomTx) {
|
if (!isCustomTx) {
|
||||||
setADBKList(addressBook)
|
setADBKList(addressBook)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user