Merge pull request #1143 from josepfo/fix/remove-miners-fee-option
fix: disable miners fee overrides field
This commit is contained in:
commit
252465764e
2 changed files with 16 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ const CheckboxInput = memo(
|
||||||
disabledMessage = '',
|
disabledMessage = '',
|
||||||
...props
|
...props
|
||||||
}) => {
|
}) => {
|
||||||
const { name, onChange, value = true } = props.field
|
const { name, onChange, value } = props.field
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
enabled: enabled,
|
enabled: enabled,
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,13 @@ const AdvancedWalletSchema = Yup.object().shape({
|
||||||
|
|
||||||
const OverridesSchema = Yup.object().shape({
|
const OverridesSchema = Yup.object().shape({
|
||||||
cryptoUnits: Yup.string().required(),
|
cryptoUnits: Yup.string().required(),
|
||||||
feeMultiplier: Yup.string().required(),
|
feeMultiplier: Yup.string()
|
||||||
|
.default(() => '1')
|
||||||
|
.required(),
|
||||||
cryptoCurrency: Yup.string().required(),
|
cryptoCurrency: Yup.string().required(),
|
||||||
allowTransactionBatching: Yup.boolean()
|
allowTransactionBatching: Yup.boolean()
|
||||||
|
.default(() => false)
|
||||||
|
.required()
|
||||||
})
|
})
|
||||||
|
|
||||||
const OverridesDefaults = {
|
const OverridesDefaults = {
|
||||||
|
|
@ -90,9 +94,10 @@ const getAdvancedWalletElements = () => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'allowTransactionBatching',
|
name: 'allowTransactionBatching',
|
||||||
|
header: `Allow BTC Transaction Batching`,
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
stripe: true,
|
stripe: true,
|
||||||
width: 250,
|
width: 260,
|
||||||
view: (_, ite) => {
|
view: (_, ite) => {
|
||||||
return ite.allowTransactionBatching ? 'Yes' : `No`
|
return ite.allowTransactionBatching ? 'Yes' : `No`
|
||||||
},
|
},
|
||||||
|
|
@ -100,7 +105,7 @@ const getAdvancedWalletElements = () => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'feeMultiplier',
|
name: 'feeMultiplier',
|
||||||
header: `Miner's Fee`,
|
header: `BTC Miner's Fee`,
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
stripe: true,
|
stripe: true,
|
||||||
width: 250,
|
width: 250,
|
||||||
|
|
@ -164,13 +169,18 @@ const getAdvancedWalletElementsOverrides = (
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
stripe: true,
|
stripe: true,
|
||||||
width: 250,
|
width: 250,
|
||||||
view: viewFeeMultiplier,
|
view: (_, ite) => {
|
||||||
|
if (ite.cryptoCurrency !== 'BTC')
|
||||||
|
return <span style={classes.editDisabled}>{`Default`}</span>
|
||||||
|
return viewFeeMultiplier(ite.feeMultiplier)
|
||||||
|
},
|
||||||
input: Autocomplete,
|
input: Autocomplete,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
options: feeOptions,
|
options: feeOptions,
|
||||||
valueProp: 'code',
|
valueProp: 'code',
|
||||||
labelProp: 'display'
|
labelProp: 'display'
|
||||||
}
|
},
|
||||||
|
editable: it => it.cryptoCurrency === 'BTC'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue