-
Notifications
You must be signed in to change notification settings - Fork 212
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
Edit label action on table's contextual menu #849
Conversation
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.
Good job @delfipolito 😍!
@@ -9,6 +9,38 @@ const IdentityContext = React.createContext({ | |||
Promise.reject(Error('Please set resolve using IdentityProvider')), | |||
}) | |||
|
|||
export function useIdentity(address) { |
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.
Let's move this down to the end of the file, and export it in the same export
declaration as the other components here.
setName(metadata ? metadata.name : null) | ||
} | ||
|
||
const handleShowLocalIdentityModal = address => { |
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 and handleNameChange()
could use useCallback()
s
} | ||
}) | ||
return () => subscription.unsubscribe() | ||
}, [address]) |
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 needs updates$
and handleNameChange
in its dependencies.
}, [transactionHash, network]) | ||
|
||
const [label, showLocalIdentityModal] = useIdentity(entity) | ||
const handleEditLabel = () => showLocalIdentityModal(entity) |
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 (and the equivalent in HolderRow
) could be wrapped in a useCallback()
No description provided.