Skip to content
This repository has been 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
merged 9 commits into from
Jan 7, 2019

Conversation

ltfschoen
Copy link
Contributor

  • 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

…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
@@ -61,6 +65,23 @@ class Send extends Component {
}
});

changeAmountFontSize = () => {
const amountElement = document.getElementById('amount');
Copy link
Collaborator

Choose a reason for hiding this comment

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

No! React uses its own virtual DOM, so we never directly modify the DOM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been looking into this but had difficulties using refs. I've also tried controlled components, and mutators unsuccessfully so far

Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

@ltfschoen
Copy link
Contributor Author

@amaurymartiny I've pushed a commit that addresses your review comment

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

<3 Thanks!

@ltfschoen
Copy link
Contributor Author

ltfschoen commented Jan 7, 2019

I've merged latest from master and fixed conflicts

@@ -42,6 +44,13 @@ class Send extends Component {
showDetails: false
};

handleSubmit = values => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert. handleSubmit is already somewhere else in the class

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

👍

@amaury1093 amaury1093 merged commit f4e3768 into master Jan 7, 2019
@amaury1093 amaury1093 deleted the luke-308-change-amount-font-size branch January 7, 2019 15:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants