-
Notifications
You must be signed in to change notification settings - Fork 19
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
Refactor token dialogs #1968
Refactor token dialogs #1968
Conversation
validate against entering a duplicate addressThis comment was generated by todo based on a
|
2ebf952
to
f6d656a
Compare
variables: { address: colonyAddress }, | ||
}); | ||
|
||
const colonyTokens = (data && data.colony.tokens) || []; |
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 will change in #1967, be aware!
|
||
const colonyTokens = (data && data.colony.tokens) || []; | ||
|
||
const addToken = useCallback( |
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 actually thought the changes will only be applied if the user presses the submit button on the dialog. It seems they are applied directly which pretty much renders the cancel button nonsensical?
const addToken = useCallback( | ||
(newTokenAddress: Address) => { | ||
const newAddresses = [ | ||
...colonyTokens.map(({ address }) => 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 probably includes eth, so we might have to remove it again
const allTokens = []; | ||
const removeToken = useCallback( | ||
(tokenAddressToRemove: Address) => { | ||
const newAddresses = colonyTokens |
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.
Same here
f6d656a
to
65e6078
Compare
Description
This PR refactors the token edit dialogs to abide by the new token logic.
New stuff ✨
TokenItem
componentChanges 🏗
dangerLink
theme forButton
Deletions ⚰️
TokenCheckbox
componentScreenshot 📷