Add ethereum icon type (#391)

This commit is contained in:
Jaco Greeff
2020-11-03 15:35:10 +01:00
committed by GitHub
parent 2b0dac8097
commit ff1a31a336
14 changed files with 865 additions and 510 deletions
@@ -0,0 +1,29 @@
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Props } from '../types';
import makeBlockie from 'ethereum-blockies-base64';
import React, { useMemo } from 'react';
import styled from 'styled-components';
function Ethereum ({ address, className = '', style }: Props): React.ReactElement<Props> {
const imgSrc = useMemo(
() => makeBlockie(address),
[address]
);
return (
<img
className={className}
src={imgSrc}
style={style}
/>
);
}
export default React.memo(styled(Ethereum)(({ size }: Props) => `
display: block;
height: ${size}px;
width: ${size}px;
`));