This repository was archived by the owner on May 24, 2022. It is now read-only.
feat: Fixes #308. Change amount font size on Send page to fit in input field#321
Merged
amaury1093 merged 9 commits intomasterfrom Jan 7, 2019
Merged
feat: Fixes #308. Change amount font size on Send page to fit in input field#321amaury1093 merged 9 commits intomasterfrom
amaury1093 merged 9 commits intomasterfrom
Conversation
…t field * Switches to font size that fits a value as small as 1 Wei on the screen when more than 9 digits entered * Switches back to default font size when amount of digits entered is 9 or less again * Caters for when user unchecks the Max Value button
amaury1093
suggested changes
Jan 2, 2019
| }); | ||
|
|
||
| changeAmountFontSize = () => { | ||
| const amountElement = document.getElementById('amount'); |
Collaborator
There was a problem hiding this comment.
No! React uses its own virtual DOM, so we never directly modify the DOM.
Contributor
Author
There was a problem hiding this comment.
I've been looking into this but had difficulties using refs. I've also tried controlled components, and mutators unsuccessfully so far
Collaborator
There was a problem hiding this comment.
An idea: on <Field name="amount">, in its className field, you can add a CSS class when the values.amount's length is longer than some value.
Contributor
Author
|
@amaurymartiny I've pushed a commit that addresses your review comment |
Contributor
Author
|
I've merged latest from master and fixed conflicts |
amaury1093
suggested changes
Jan 7, 2019
| showDetails: false | ||
| }; | ||
|
|
||
| handleSubmit = values => { |
Collaborator
There was a problem hiding this comment.
Revert. handleSubmit is already somewhere else in the class
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.
Switches to font size that fits a value as small as 1 Wei on the screen when more than 9 digits entered
Switches back to default font size when amount of digits entered is 9 or less again
Caters for when user unchecks the Max Value button