mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-13 11:36:45 +00:00
16 lines
488 B
JavaScript
16 lines
488 B
JavaScript
import React from 'react';
|
|
import { toDataUrl } from 'ethereum-blockies';
|
|
import { isValidAddress } from 'eth/validators';
|
|
|
|
type Props = {
|
|
address: string
|
|
};
|
|
|
|
export default function Identicon(props: Props) {
|
|
// FIXME breaks on failed checksums
|
|
const style = !isValidAddress(props.address)
|
|
? {}
|
|
: { backgroundImage: `url(${toDataUrl(props.address.toLowerCase())})` };
|
|
return <div className="addressIdenticon" style={style} title="Address Indenticon" />;
|
|
}
|