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

Refactor token dialogs #1968

Merged
merged 3 commits into from
Jan 20, 2020
Merged

Conversation

ceolson01
Copy link
Contributor

⚠️ This PR is based on #1967

Description

This PR refactors the token edit dialogs to abide by the new token logic.

New stuff

  • TokenItem component

Changes 🏗

  • Added a dangerLink theme for Button

Deletions ⚰️

  • TokenCheckbox component

Screenshot 📷

Screen Shot 2020-01-17 at 6 30 03 PM

@ceolson01 ceolson01 requested a review from chmanie January 18, 2020 00:30
@ceolson01 ceolson01 self-assigned this Jan 18, 2020
@todo
Copy link

todo bot commented Jan 18, 2020

validate against entering a duplicate address

https://github.com/JoinColony/colonyDapp/blob/2ebf952cb77c96f19f101aaecb7104f87cf5c8f8/src/modules/core/components/TokenEditDialog/TokenEditDialog.tsx#L66-L71


This comment was generated by todo based on a todo comment in 2ebf952cb77c96f19f101aaecb7104f87cf5c8f8 in #1968. cc @JoinColony.

@ceolson01 ceolson01 force-pushed the refactor/token-info-dialogs branch from 2ebf952 to f6d656a Compare January 18, 2020 00:34
variables: { address: colonyAddress },
});

const colonyTokens = (data && data.colony.tokens) || [];
Copy link
Member

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(
Copy link
Member

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),
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@ceolson01 ceolson01 force-pushed the refactor/token-info-dialogs branch from f6d656a to 65e6078 Compare January 20, 2020 15:10
@ceolson01 ceolson01 merged this pull request into refactor/token-info Jan 20, 2020
@ceolson01 ceolson01 deleted the refactor/token-info-dialogs branch January 20, 2020 15:20
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.

2 participants