diff --git a/src/components/Identicon/index.tsx b/src/components/Identicon/index.tsx index 905c757069..db6bc1d460 100644 --- a/src/components/Identicon/index.tsx +++ b/src/components/Identicon/index.tsx @@ -1,4 +1,5 @@ -import Davatar from '@davatar/react' +import Davatar, { Image } from '@davatar/react' +import { useMemo } from 'react' import styled from 'styled-components/macro' import { useActiveWeb3React } from '../../hooks/web3' @@ -13,10 +14,19 @@ const StyledIdenticonContainer = styled.div` export default function Identicon() { const { account, library } = useActiveWeb3React() - // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30451 + // restrict usage of Davatar until it stops sending 3p requests + // see https://github.com/metaphor-xyz/davatar-helpers/issues/18 + const supportsENS = useMemo(() => { + return ([1, 3, 4, 5] as Array).includes(library?.network.chainId) + }, [library]) + return ( - {account && library?.provider && } + {account && supportsENS ? ( + + ) : ( + + )} ) }