fix all step properties, removing publish or send minimums app-side

This commit is contained in:
Jeremy Kauffman 2017-09-29 16:51:36 -04:00
parent d39664a0fd
commit ca6ef4e11f
6 changed files with 6 additions and 10 deletions

View file

@ -34,7 +34,7 @@ class FormFieldPrice extends React.PureComponent {
}
render() {
const { defaultValue, placeholder, min, step } = this.props;
const { defaultValue, placeholder, min } = this.props;
return (
<span className="form-field">
@ -43,7 +43,7 @@ class FormFieldPrice extends React.PureComponent {
name="amount"
min={min}
placeholder={placeholder || null}
step={step}
step="any" //Unfortunately, you cannot set a step without triggering validation that enforces a multiple of the step
onChange={event => this.handleFeeAmountChange(event)}
defaultValue={
defaultValue && defaultValue.amount ? defaultValue.amount : ""

View file

@ -148,7 +148,7 @@ class ChannelSection extends React.PureComponent {
<FormRow
label={__("Deposit")}
postfix="LBC"
step="0.1"
step="any"
min="0"
type="number"
helper={lbcInputHelp}

View file

@ -663,10 +663,8 @@ class PublishForm extends React.PureComponent {
checked={this.state.isFee}
/>
<span className={!this.state.isFee ? "hidden" : ""}>
{/*min=0.01 caused weird interactions with step (e.g. down from 5 equals 4.91 rather than 4.9) */}
<FormFieldPrice
min="0"
step="0.1"
defaultValue={{ amount: 5.0, currency: "LBC" }}
onChange={val => this.handleFeeChange(val)}
/>
@ -823,7 +821,7 @@ class PublishForm extends React.PureComponent {
<FormRow
ref="bid"
type="number"
step="0.1"
step="any"
label={__("Deposit")}
postfix="LBC"
onChange={event => {

View file

@ -33,7 +33,7 @@ class WalletSend extends React.PureComponent {
<FormRow
label={__("Amount")}
postfix={__("LBC")}
step="0.1"
step="any"
min="0"
type="number"
placeholder="1.23"

View file

@ -37,7 +37,7 @@ class WalletSendTip extends React.PureComponent {
label={__("Amount")}
postfix={__("LBC")}
min="0"
step="0.1"
step="any"
type="number"
errorMessage={errorMessage}
helper={

View file

@ -218,7 +218,6 @@ class SettingsPage extends React.PureComponent {
{!daemonSettings.disable_max_key_fee &&
<FormFieldPrice
min="0"
step="1"
onChange={this.onKeyFeeChange.bind(this)}
defaultValue={
daemonSettings.max_key_fee
@ -264,7 +263,6 @@ class SettingsPage extends React.PureComponent {
{instantPurchaseEnabled &&
<FormFieldPrice
min="0.1"
step="0.1"
onChange={val => this.onInstantPurchaseMaxChange(val)}
defaultValue={instantPurchaseMax}
/>}