refactor: improve styling code readability
This commit is contained in:
parent
75fa4e703c
commit
4f7f7715bc
2 changed files with 11 additions and 8 deletions
|
|
@ -24,13 +24,13 @@ const Cashbox = ({
|
||||||
const classes = cashboxClasses({ percent, cashOut })
|
const classes = cashboxClasses({ percent, cashOut })
|
||||||
const threshold = 51
|
const threshold = 51
|
||||||
|
|
||||||
|
const showCashBox = {
|
||||||
|
[classes.fiatBalanceAlertCashbox]: inFiatBalanceAlerts,
|
||||||
|
[classes.cashbox]: !inFiatBalanceAlerts
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div className={classnames(className, showCashBox)}>
|
||||||
className={
|
|
||||||
inFiatBalanceAlerts
|
|
||||||
? classnames(className, classes.fiatBalanceAlertCashbox)
|
|
||||||
: classnames(className, classes.cashbox)
|
|
||||||
}>
|
|
||||||
<div className={classnames(emptyPartClassName, classes.emptyPart)}>
|
<div className={classnames(emptyPartClassName, classes.emptyPart)}>
|
||||||
{!inFiatBalanceAlerts && percent <= threshold && (
|
{!inFiatBalanceAlerts && percent <= threshold && (
|
||||||
<Label2 className={labelClassName}>{percent.toFixed(0)}%</Label2>
|
<Label2 className={labelClassName}>{percent.toFixed(0)}%</Label2>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { makeStyles } from '@material-ui/core'
|
import { makeStyles } from '@material-ui/core'
|
||||||
import { Form, Formik } from 'formik'
|
import { Form, Formik } from 'formik'
|
||||||
|
import * as R from 'ramda'
|
||||||
import React, { useContext } from 'react'
|
import React, { useContext } from 'react'
|
||||||
import * as Yup from 'yup'
|
import * as Yup from 'yup'
|
||||||
|
|
||||||
|
|
@ -47,8 +48,10 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
||||||
validateOnChange={false}
|
validateOnChange={false}
|
||||||
enableReinitialize
|
enableReinitialize
|
||||||
initialValues={{
|
initialValues={{
|
||||||
fillingPercentageCassette1: data?.fillingPercentageCassette1 ?? '',
|
fillingPercentageCassette1:
|
||||||
fillingPercentageCassette2: data?.fillingPercentageCassette2 ?? ''
|
R.path(['fillingPercentageCassette1'])(data) ?? '',
|
||||||
|
fillingPercentageCassette2:
|
||||||
|
R.path(['fillingPercentageCassette2'])(data) ?? ''
|
||||||
}}
|
}}
|
||||||
validationSchema={schema}
|
validationSchema={schema}
|
||||||
onSubmit={it => save(section, schema.cast(it))}
|
onSubmit={it => save(section, schema.cast(it))}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue