-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: excessive cpu usage from avatar component #1609
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -45,7 +45,7 @@ export function Avatar({ address, imageUrl, loading, size }: AvatarProps) { | |||
> | |||
<AvatarComponent address={address} ensImage={imageUrl} size={size} /> | |||
</Box> | |||
{typeof loading === 'boolean' && ( | |||
{loading && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to only show the spinner if it's true
. Since typeof loading === 'boolean'
will always be true because it had false
all the time.
<Box | ||
color="accentColor" | ||
display="flex" | ||
height="full" | ||
position="absolute" | ||
style={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add these styles back, or no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah. They are not needed anymore since they are only used for transition effects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👌
Related to this issue: #934