fix: remove the function to get the values when editing balance alerts

This commit is contained in:
José Oliveira 2021-06-17 18:01:36 +01:00 committed by Josh Harvey
parent cdab60069c
commit 410bc25afb

View file

@ -42,9 +42,6 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
.nullable() .nullable()
}) })
const getPercentage = fillingPercentage =>
fillingPercentage ?? data?.fillingPercentageCassette1
return ( return (
<Formik <Formik
validateOnBlur={false} validateOnBlur={false}
@ -76,7 +73,10 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
<Cashbox <Cashbox
labelClassName={classes.cashboxLabel} labelClassName={classes.cashboxLabel}
emptyPartClassName={classes.cashboxEmptyPart} emptyPartClassName={classes.cashboxEmptyPart}
percent={getPercentage(values.fillingPercentageCassette1)} percent={
values.fillingPercentageCassette1 ??
data?.fillingPercentageCassette1
}
inFiatBalanceAlerts={true} inFiatBalanceAlerts={true}
cashOut cashOut
/> />
@ -97,7 +97,10 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
<Cashbox <Cashbox
labelClassName={classes.cashboxLabel} labelClassName={classes.cashboxLabel}
emptyPartClassName={classes.cashboxEmptyPart} emptyPartClassName={classes.cashboxEmptyPart}
percent={getPercentage(values.fillingPercentageCassette2)} percent={
values.fillingPercentageCassette2 ??
data?.fillingPercentageCassette2
}
inFiatBalanceAlerts={true} inFiatBalanceAlerts={true}
cashOut cashOut
/> />