fix: disable miners fee overrides field

This commit is contained in:
José Oliveira 2022-03-02 16:58:47 +00:00
parent c8f5e471be
commit f7ea781f4e
2 changed files with 10 additions and 5 deletions

View file

@ -11,7 +11,7 @@ const CheckboxInput = memo(
disabledMessage = '',
...props
}) => {
const { name, onChange, value = true } = props.field
const { name, onChange, value } = props.field
const settings = {
enabled: enabled,

View file

@ -38,7 +38,7 @@ const AdvancedWalletSchema = Yup.object().shape({
const OverridesSchema = Yup.object().shape({
cryptoUnits: Yup.string().required(),
feeMultiplier: Yup.string().required(),
feeMultiplier: Yup.string(),
cryptoCurrency: Yup.string().required(),
allowTransactionBatching: Yup.boolean()
})
@ -100,7 +100,7 @@ const getAdvancedWalletElements = () => {
},
{
name: 'feeMultiplier',
header: `Miner's Fee`,
header: `BTC Miner's Fee`,
size: 'sm',
stripe: true,
width: 250,
@ -164,13 +164,18 @@ const getAdvancedWalletElementsOverrides = (
size: 'sm',
stripe: true,
width: 250,
view: viewFeeMultiplier,
view: (_, ite) => {
if (ite.cryptoCurrency !== 'BTC')
return <span style={classes.editDisabled}>{`Default`}</span>
return viewFeeMultiplier(ite.feeMultiplier)
},
input: Autocomplete,
inputProps: {
options: feeOptions,
valueProp: 'code',
labelProp: 'display'
}
},
editable: it => it.cryptoCurrency === 'BTC'
}
]
}