-
Notifications
You must be signed in to change notification settings - Fork 433
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: prevent key prop warning in EthHashInfo #2351
Conversation
Fix: prevent key prop warning in EthHashInfo Fix: prevent key prop warning in EthHashInfo
Branch preview✅ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
{showAvatar && ( | ||
<AvatarContainer size={avatarSize}> | ||
{!fallbackToIdenticon && customAvatar ? ( | ||
<img src={customAvatar} alt={address} onError={onError} width={avatarSize} height={avatarSize} /> |
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.
I think we can use ImageFallback
here.
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.
We might need to adjust ImageFallback
to support a custom component as src. Maybe easier to leave it as it is
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.
ImageFallback
has a fallbackComponent
prop.
) | ||
} | ||
|
||
const Container = styled('div')({ |
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.
This is only being used here. Can we use a div with a class or Box
instead?
}, | ||
})) | ||
|
||
const AddressContainer = styled('div')({ |
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.
Similar here, its only used once so we could change it to a div with a class or Mui Box
<IconButton | ||
className={className} | ||
target="_blank" | ||
rel="noreferrer" | ||
href={href} | ||
size="small" | ||
sx={{ color: 'inherit' }} | ||
> |
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.
There was a stopPropagation
call onClick here. Is it not needed anymore?
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.
Where was it exactly? I can't find it in the change set.
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.
It was part of safe-react-components
size="small" | ||
sx={{ color: 'inherit' }} | ||
> | ||
<SvgIcon component={icon} inheritViewBox fontSize="small" /> |
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.
The custom Icon
component had some css set on the SvgIcon
. Is it still covered after porting?
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.
It looks the same to me in the end result, but again, I'm not sure which original code you're referring to. In safe-react-components?
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.
Yes, I was comparing it to what we have in safe-react-components.
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.
True, stopPropagation
was actually necessary to prevent NFT previews from opening on the NFT page (5afe/safe-react-components#220).
I'll restore it in another PR.
@@ -100,7 +100,7 @@ describe('ApprovalEditorForm', () => { | |||
|
|||
// Change value and save | |||
const amountInput = result.container.querySelector('input[name="approvals.0"]') as HTMLInputElement | |||
const saveButton = result.getByRole('button') | |||
const saveButton = result.getByTitle('Save') |
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 👍
dd9a47c
to
deef9fc
Compare
I'm going to merge this as there are no visual changes here. |
This PR removes the pesky React warning about a "key" prop in the console.
I fixed it by copying
EthHashInfo
from safe-react-components to this repo because the problem stems from the safe-react-components's build not working well with this app's build system.Also updated dependencies along the way.