This repository was archived by the owner on May 24, 2022. It is now read-only.
Add Max button to send the whole balance#302
Merged
amaury1093 merged 19 commits intomasterfrom Dec 20, 2018
Merged
Conversation
Collaborator
Author
|
Happy to get some more ideas about the look&feel.
|
Collaborator
Author
|
TODO: |
amaury1093
suggested changes
Dec 18, 2018
Collaborator
amaury1093
left a comment
There was a problem hiding this comment.
Works well, some code needs change.
At first the amount not being in the middle also felt a bit weird. Idea: put the max button smaller, cf #38? So that amount still seems in the middle.
Collaborator
Author
Collaborator
Author
amaury1093
reviewed
Dec 20, 2018
Collaborator
amaury1093
left a comment
There was a problem hiding this comment.
I like the small button design
|
|
||
| if (token.address === 'ETH') { | ||
| output = fromWei( | ||
| toWei(balance).minus(gasBn.mul(toWei(gasPriceBn, 'shannon'))) |
Collaborator
There was a problem hiding this comment.
I would prefer to merge #274 first, because the syntax is changed to .multipliedBy
Collaborator
Author
|
on ice until we merge #274 |
Collaborator
|
Will rebase #274 on top of this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



closes #254
TODO:
1. Understand why the max button actually submits the form2. Understand this
3. Style the button. More on this later (using this would be great but I couldn't manage to make it work so far)
4. Test with ERC20
I need help regarding 1. and 2. @axelchalon, @amaurymartiny or @yjkimjunior whoever has time :)Looks like this:

it acts as a toggle button, the gas and address can be changed and the amount will update accordingly, if max is selected, the amount field is disabled.