Skip to content
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

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Nov 13, 2023

Related to this issue: #934

@magiziz magiziz requested a review from a team as a code owner November 13, 2023 14:33
Copy link

vercel bot commented Nov 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rainbowkit-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 16, 2023 4:03am
rainbowkit-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 16, 2023 4:03am

@@ -45,7 +45,7 @@ export function Avatar({ address, imageUrl, loading, size }: AvatarProps) {
>
<AvatarComponent address={address} ensImage={imageUrl} size={size} />
</Box>
{typeof loading === 'boolean' && (
{loading && (
Copy link
Contributor Author

@magiziz magiziz Nov 13, 2023

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={{
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Collaborator

@DanielSinclair DanielSinclair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants