import {
RainbowKitProvider,
AvatarComponent,
} from '@rainbow-me/rainbowkit';
import { generateColorFromAddress } from './utils';
const CustomAvatar: AvatarComponent = ({ address, ensImage, size }) => {
const color = generateColorFromAddress(address);
return ensImage ? (
<img
src={ensImage}
width={size}
height={size}
style={{ borderRadius: 999 }}
/>
) : (
<div
style={{
backgroundColor: color,
borderRadius: 999,
height: size,
width: size,
}}
>
:^)
</div>
);
};
const App = () => {
return (
<RainbowKitProvider avatar={CustomAvatar} {...etc}>
{}
</RainbowKitProvider>
);
};