chore: remove dead code

This commit is contained in:
André Sá 2021-10-29 12:52:46 +01:00
parent 0a0efd70ab
commit a3a069f335

View file

@ -3,11 +3,8 @@ import classnames from 'classnames'
import React from 'react'
import Chip from 'src/components/Chip'
import { Link } from 'src/components/buttons'
import { Info2, Label1, Label2 } from 'src/components/typography'
import TextInputFormik from '../base/TextInput'
import { cashboxStyles, gridStyles } from './Cashbox.styles'
const cashboxClasses = makeStyles(cashboxStyles)
@ -72,44 +69,6 @@ const CashIn = ({ currency, notes, total }) => {
)
}
const CashInFormik = ({
capacity = 1000,
onEmpty,
field: {
value: { notes, deviceId }
},
form: { setFieldValue }
}) => {
const classes = gridClasses()
return (
<>
<div className={classes.row}>
<div>
<Cashbox percent={(100 * notes) / capacity} />
</div>
<div className={classes.col2}>
<div>
<Link
onClick={() => {
onEmpty({
variables: {
deviceId,
action: 'emptyCashInBills'
}
}).then(() => setFieldValue('cashin.notes', 0))
}}
className={classes.link}
color={'primary'}>
Empty
</Link>
</div>
</div>
</div>
</>
)
}
const CashOut = ({
capacity = 500,
denomination = 0,
@ -154,42 +113,4 @@ const CashOut = ({
)
}
const CashOutFormik = ({ capacity = 500, ...props }) => {
const {
name,
onChange,
onBlur,
value: { notes }
} = props.field
const { touched, errors } = props.form
const error = !!(touched[name] && errors[name])
const percent = (100 * notes) / capacity
const classes = gridClasses()
return (
<>
<div className={classes.row}>
<div className={classes.col}>
<Cashbox percent={percent} cashOut />
</div>
<div className={(classes.col, classes.col2)}>
<div>
<TextInputFormik
fullWidth
name={name + '.notes'}
onChange={onChange}
onBlur={onBlur}
value={notes}
error={error}
{...props}
/>
</div>
</div>
</div>
</>
)
}
export { Cashbox, CashIn, CashInFormik, CashOut, CashOutFormik }
export { Cashbox, CashIn, CashOut }