We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import jazzicon from '@metamask/jazzicon' import React, { CSSProperties, useEffect, useRef } from 'react' interface Props { account: string size: number style?: CSSProperties } const MetaMaskAvatar: React.FC<Props> = ({ account, size, style }) => { const avatarRef = useRef<HTMLDivElement>(null) useEffect(() => { const element = avatarRef.current if (element && account) { const addr = account.slice(2, 10) const seed = parseInt(addr, 16) const icon = jazzicon(size, seed) if (element.firstChild) { element.removeChild(element.firstChild) } element.appendChild(icon) } }, [account, avatarRef, size]) return <div style={style} ref={avatarRef} /> } export default MetaMaskAvatar
The text was updated successfully, but these errors were encountered:
you can use this package to solve your question. https://www.npmjs.com/package/@cfx-kit/wallet-avatar
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: