mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-04-22 11:28:00 +00:00
Add ethereum icon type (#391)
This commit is contained in:
@@ -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;
|
||||
`));
|
||||
Reference in New Issue
Block a user