diff --git a/CHANGELOG.md b/CHANGELOG.md index 80c4d8d48..2c4dd3b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Web UI version numbers should always match the corresponding version of LBRY App ### Fixed * 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) + * Fixed showing "other currency" help tip in publish form, which was caused due to not "setting" state for price * ### Deprecated @@ -27,6 +28,7 @@ Web UI version numbers should always match the corresponding version of LBRY App ### Removed * Removed the label "Max Purchase Price" from settings page. It was redundant. + * Unused old files from previous commit(9c3d633) * ## [0.14.3] - 2017-08-03 diff --git a/ui/js/component/priceForm/index.js b/ui/js/component/priceForm/index.js deleted file mode 100644 index f56521afe..000000000 --- a/ui/js/component/priceForm/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -import { connect } from "react-redux"; -import FormFieldPrice from "./view"; - -export default connect(null, null)(FormFieldPrice); diff --git a/ui/js/component/priceForm/view.jsx b/ui/js/component/priceForm/view.jsx deleted file mode 100644 index 4599deb04..000000000 --- a/ui/js/component/priceForm/view.jsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from "react"; -import FormField from "component/formField"; - -class FormFieldPrice extends React.PureComponent { - constructor(props) { - super(props); - this.state = { - price: { - feeAmount: "", - feeCurrency: "LBC", - }, - }; - } - - handleFeeAmountChange(event) { - this.setState({ - price: { - ...this.state.price, - feeAmount: event.target.value, - }, - }); - this.props.onChange(event.target.name, this.state.price); - } - - handleFeeCurrencyChange(event) { - this.setState({ - price: { - ...this.state.price, - feeCurrency: event.target.value, - }, - }); - this.props.onChange(event.target.name, this.state.price); - } - - render() { - const { - defaultAmount, - defaultCurrency, - placeholder, - min, - step, - } = this.props; - - return ( - - this.handleFeeAmountChange(event)} - defaultValue={defaultAmount} - className="form-field__input--inline" - /> - this.handleFeeCurrencyChange(event)} - defaultValue={defaultCurrency} - className="form-field__input--inline" - > - - - - - ); - } -} - -export default FormFieldPrice; diff --git a/ui/js/component/publishForm/view.jsx b/ui/js/component/publishForm/view.jsx index a8970a7d5..686e382ca 100644 --- a/ui/js/component/publishForm/view.jsx +++ b/ui/js/component/publishForm/view.jsx @@ -309,8 +309,10 @@ class PublishForm extends React.PureComponent { } handleFeeChange(newValue) { - this.state.feeAmount = newValue.amount; - this.state.feeCurrency = newValue.currency; + this.setState({ + feeAmount: newValue.amount, + feeCurrency: newValue.currency, + }); } handleFeePrefChange(feeEnabled) { @@ -670,12 +672,7 @@ class PublishForm extends React.PureComponent { onChange={val => this.handleFeeChange(val)} /> - {/* - && this.state.feeCurrency.toUpperCase() != "LBC" - for some reason, react does not trigger a re-render on currency change (despite trigger a state change), so - the above logic cannot be added to the below check - */} - {this.state.isFee + {this.state.isFee && this.state.feeCurrency.toUpperCase() != "LBC" ?
{__( "All content fees are charged in LBC. For non-LBC payment methods, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase."