Files
pezkuwi-ui/packages/react-identicon/src/icons/Beachball.tsx
T
Jaco Greeff f003063b94 2021 (#424)
2021-01-03 11:46:19 +01:00

30 lines
712 B
TypeScript

// Copyright 2017-2021 @polkadot/react-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Props } from '../types';
import React, { useCallback } from 'react';
import { beachballIcon } from '@polkadot/ui-shared';
function Identicon ({ address, className = '', size, style }: Props): React.ReactElement<Props> {
const updateElem = useCallback(
(node: HTMLDivElement): void => {
node && node.appendChild(
beachballIcon(address, { isAlternative: false, size })
);
},
[address, size]
);
return (
<div
className={className}
ref={updateElem}
style={style}
/>
);
}
export const Beachball = React.memo(Identicon);