mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-07-24 21:45:43 +00:00
30 lines
770 B
TypeScript
30 lines
770 B
TypeScript
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
import { Props } from '../types';
|
|
|
|
import React, { useCallback } from 'react';
|
|
import generate from '@polkadot/ui-shared/beachballIcon';
|
|
|
|
function Beachball ({ address, className, size, style }: Props): React.ReactElement<Props> {
|
|
const updateElem = useCallback(
|
|
(node: HTMLDivElement): void => {
|
|
node && node.appendChild(
|
|
generate(address, size)
|
|
);
|
|
},
|
|
[address, size]
|
|
);
|
|
|
|
return (
|
|
<div
|
|
className={`container ${className}`}
|
|
ref={updateElem}
|
|
style={style}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Beachball);
|