Using setState in formFieldPrice #449
2 changed files with 10 additions and 7 deletions
|
@ -20,6 +20,7 @@ Web UI version numbers should always match the corresponding version of LBRY App
|
||||||
* Tiles will no longer be blurry on hover (Windows only bug)
|
* Tiles will no longer be blurry on hover (Windows only bug)
|
||||||
* Removed placeholder values from price selection form fields, which was causing confusion that these were real values (#426)
|
* Removed placeholder values from price selection form fields, which was causing confusion that these were real values (#426)
|
||||||
* Fixed showing "other currency" help tip in publish form, which was caused due to not "setting" state for price
|
* Fixed showing "other currency" help tip in publish form, which was caused due to not "setting" state for price
|
||||||
|
* Now using setState in formFieldPrice
|
||||||
*
|
*
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
@ -14,21 +14,23 @@ class FormFieldPrice extends React.PureComponent {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatchChange() {
|
handleChange(newValues) {
|
||||||
|
const newState = Object.assign({}, this.state, newValues);
|
||||||
|
this.setState(newState);
|
||||||
this.props.onChange({
|
this.props.onChange({
|
||||||
amount: this.state.amount,
|
amount: newState.amount,
|
||||||
currency: this.state.currency,
|
currency: newState.currency,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFeeAmountChange(event) {
|
handleFeeAmountChange(event) {
|
||||||
this.state.amount = event.target.value ? Number(event.target.value) : null;
|
this.handleChange({
|
||||||
this.dispatchChange();
|
amount: event.target.value ? Number(event.target.value) : null,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFeeCurrencyChange(event) {
|
handleFeeCurrencyChange(event) {
|
||||||
this.state.currency = event.target.value;
|
this.handleChange({ currency: event.target.value });
|
||||||
this.dispatchChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue