diff --git a/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx b/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx index 290cd127..00b196ac 100644 --- a/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx @@ -1,87 +1,12 @@ -import { makeStyles } from '@mui/styles' import Chip from '@mui/material/Chip' import * as R from 'ramda' import React from 'react' import { Label1, TL2 } from 'src/components/typography' import { CashOut } from 'src/components/inputs' -import { offDarkColor } from 'src/styling/variables' import { fromNamespace } from 'src/utils/config' import { getCashUnitCapacity, modelPrettifier } from 'src/utils/machine' -const styles = { - wrapper: { - display: 'flex', - flexDirection: 'row', - marginTop: 12, - marginBottom: 16, - '& > *': { - marginRight: 40 - }, - '& > *:last-child': { - marginRight: 0 - }, - minHeight: 120 - }, - row: { - display: 'flex', - flexDirection: 'row' - }, - col: { - display: 'flex', - flexDirection: 'column' - }, - machineData: { - display: 'flex', - flexDirection: 'column', - minWidth: 210 - }, - billList: ({ hideMachineData }) => ({ - display: 'flex', - flexDirection: 'column', - minWidth: hideMachineData ? 60 : 160, - '& > span': { - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - '& > p': { - minWidth: 30 - } - } - }), - unitList: { - display: 'flex', - flexDirection: 'row', - '& > *': { - marginRight: 20 - }, - '& > *:last-child': { - marginRight: 0 - }, - marginTop: 10 - }, - verticalLine: { - height: '100%', - width: 1, - backgroundColor: offDarkColor - }, - label: { - marginBottom: 10 - }, - loadingBoxes: { - display: 'flex', - flexDirection: 'column', - '& > *': { - marginBottom: 20 - }, - '& > *:last-child': { - marginBottom: 0 - } - } -} - -const useStyles = makeStyles(styles) - const CashUnitDetails = ({ machine, bills, @@ -89,38 +14,40 @@ const CashUnitDetails = ({ config, hideMachineData = false }) => { - const classes = useStyles({ hideMachineData }) const billCount = R.countBy(it => it.fiat)(bills) const fillingPercentageSettings = fromNamespace('notifications', config) const cashout = fromNamespace('cashOut')(config) const getCashoutSettings = id => fromNamespace(id)(cashout) + const minWidth = hideMachineData ? 'min-w-15' : 'min-w-40' + const VerticalLine = () => + return ( -
+
{!hideMachineData && ( -
+
Machine Model {modelPrettifier[machine.model]}
)} -
+
Cash box {R.isEmpty(billCount) && Empty} {R.keys(billCount).map((it, idx) => ( - - {billCount[it]} + + + {billCount[it]} + ))}
-
+
{machine.numberOfRecyclers === 0 && R.map(it => ( <> -
- {`Cassette ${it}`} +
+ {`Cassette ${it}`}
- {it !== machine.numberOfCassettes && ( - - )} + {it !== machine.numberOfCassettes && } ))(R.range(1, machine.numberOfCassettes + 1))} {machine.numberOfRecyclers > 0 && ( <> -
- {`Loading boxes`} -
+
+ {`Loading boxes`} +
{R.range(1, machine.numberOfCassettes + 1).map((it, idx) => (
- + {R.map(it => ( <> -
- +
+ {`Recycler ${ machine.model === 'aveiro' ? `${it} f/r` : `${it * 2 - 1} - ${it * 2}` }`} -
+
- {it !== machine.numberOfRecyclers / 2 && ( - - )} + {it !== machine.numberOfRecyclers / 2 && } ))(R.range(1, machine.numberOfRecyclers / 2 + 1))} diff --git a/new-lamassu-admin/src/pages/Maintenance/CashUnits.jsx b/new-lamassu-admin/src/pages/Maintenance/CashUnits.jsx index 16aaad7c..66635201 100644 --- a/new-lamassu-admin/src/pages/Maintenance/CashUnits.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/CashUnits.jsx @@ -1,6 +1,5 @@ import { useQuery, useMutation, gql } from '@apollo/client' import DialogActions from '@mui/material/DialogActions' -import { makeStyles } from '@mui/styles' import * as R from 'ramda' import React, { useState } from 'react' import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper' @@ -21,14 +20,11 @@ import { MANUAL, AUTOMATIC } from 'src/utils/constants' import { onlyFirstToUpper } from 'src/utils/string' import CashUnitDetails from './CashUnitDetails' -import styles from './CashUnits.styles' import CashCassettesFooter from './CashUnitsFooter' import CashboxHistory from './CashboxHistory' import Wizard from './Wizard/Wizard' import helper from './helper' -const useStyles = makeStyles(styles) - const GET_MACHINES_AND_CONFIG = gql` query getData($billFilters: JSONObject) { machines { @@ -114,7 +110,6 @@ const widths = { } const CashCassettes = () => { - const classes = useStyles() const [showHistory, setShowHistory] = useState(false) const [editingSchema, setEditingSchema] = useState(null) const [selectedRadio, setSelectedRadio] = useState(null) @@ -219,7 +214,7 @@ const CashCassettes = () => { { component: showHistory ? ( { ) } ]} - iconClassName={classes.listViewButton} - className={classes.tableWidth} + className="flex items-center mr-[1px]" appendix={

@@ -248,18 +242,17 @@ const CashCassettes = () => { }> {!showHistory && ( -

- Cash box resets +
+ + Cash box resets +
{cashboxReset && ( -

+

{onlyFirstToUpper(cashboxReset)}

)} - setEditingSchema(true)} - className={classes.button} - size="large"> + setEditingSchema(true)} size="large">
@@ -275,7 +268,7 @@ const CashCassettes = () => { Details={InnerCashUnitDetails} emptyText="No machines so far" expandable - tableClassName={classes.dataTable} + tableClassName="mb-20" /> {data && R.isEmpty(machines) && ( @@ -315,7 +308,7 @@ const CashCassettes = () => { width={478} handleClose={() => setEditingSchema(null)} open={true}> -

+

We can automatically assume you emptied a bill validator's cash box when the machine detects that it has been removed.

@@ -324,9 +317,8 @@ const CashCassettes = () => { value={selectedRadio ?? cashboxReset} options={[radioButtonOptions[0]]} onChange={handleRadioButtons} - className={classes.radioButtons} /> -

+

Assume the cash box is emptied whenever it's removed, creating a new batch on the history screen and setting its current balance to zero. @@ -336,14 +328,13 @@ const CashCassettes = () => { value={selectedRadio ?? cashboxReset} options={[radioButtonOptions[1]]} onChange={handleRadioButtons} - className={classes.radioButtons} /> -

+

Cash boxes won't be assumed emptied when removed, nor their counts modified. Instead, to update the count and create a new batch, you'll click the 'Edit' button on this panel.

- + diff --git a/new-lamassu-admin/src/pages/Maintenance/CashUnits.styles.js b/new-lamassu-admin/src/pages/Maintenance/CashUnits.styles.js deleted file mode 100644 index 2c46a149..00000000 --- a/new-lamassu-admin/src/pages/Maintenance/CashUnits.styles.js +++ /dev/null @@ -1,33 +0,0 @@ -import { offColor, offDarkColor } from 'src/styling/variables' - -export default { - cashbox: { - height: 36 - }, - tBody: { - maxHeight: 'calc(100vh - 350px)', - overflow: 'auto' - }, - tableWidth: { - display: 'flex', - alignItems: 'center', - marginRight: 1 - }, - descriptions: { - color: offColor, - marginTop: 0 - }, - cashboxReset: { - color: offColor, - margin: [[13, 0, -5, 20]] - }, - selection: { - marginRight: 12 - }, - downloadLogsButton: { - marginLeft: 13 - }, - dataTable: { - marginBottom: 80 - } -} diff --git a/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.jsx b/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.jsx index bbbab515..856828af 100644 --- a/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.jsx @@ -1,4 +1,3 @@ -import { makeStyles } from '@mui/styles' import BigNumber from 'bignumber.js' import * as R from 'ramda' import React from 'react' @@ -9,10 +8,6 @@ import TxOutIcon from 'src/styling/icons/direction/cash-out.svg?react' import { fromNamespace } from 'src/utils/config' import { numberToFiatAmount } from 'src/utils/number' -import styles from './CashUnitsFooter.styles' - -const useStyles = makeStyles(styles) - const CashCassettesFooter = ({ machines, config, @@ -20,7 +15,6 @@ const CashCassettesFooter = ({ bills, deviceIds }) => { - const classes = useStyles() const cashout = config && fromNamespace('cashOut')(config) const getCashoutSettings = id => fromNamespace(id)(cashout) const cashoutReducerFn = ( @@ -84,33 +78,33 @@ const CashCassettesFooter = ({ ).toFormat(0) return ( -
-
- Cash value in System -
- - Cash-in: - +
+
+ Cash value in System +
+ + Cash-in: + {numberToFiatAmount(totalInCashBox)} {currencyCode}
-
- - Cash-out: - +
+ + Cash-out: + {numberToFiatAmount(totalInCassettes)} {currencyCode}
-
- - Recycle: - +
+ + Recycle: + {numberToFiatAmount(totalInRecyclers)} {currencyCode}
-
- Total: - +
+ Total: + {numberToFiatAmount(total)} {currencyCode}
diff --git a/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.styles.js b/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.styles.js deleted file mode 100644 index a0a2484b..00000000 --- a/new-lamassu-admin/src/pages/Maintenance/CashUnitsFooter.styles.js +++ /dev/null @@ -1,42 +0,0 @@ -import { comet } from 'src/styling/variables' - -export default { - footerLabel: { - color: comet, - alignSelf: 'center' - }, - footerContent: { - width: 1200, - maxHeight: 64, - display: 'flex', - justifyContent: 'space-around', - position: 'fixed' - }, - footerContainer: { - position: 'fixed', - height: 64, - left: 0, - bottom: 0, - width: '100vw', - backgroundColor: 'white', - display: 'flex', - justifyContent: 'space-around', - boxShadow: [[0, -1, 10, 0, 'rgba(50, 50, 50, 0.1)']] - }, - flex: { - display: 'flex' - }, - icon: { - alignSelf: 'center', - height: 20, - width: 20, - marginRight: 8 - }, - iconLabel: { - alignSelf: 'center', - marginRight: 8 - }, - valueDisplay: { - alignSelf: 'center' - } -} diff --git a/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.jsx b/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.jsx index 580fa0be..70b8f41e 100644 --- a/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.jsx @@ -1,17 +1,11 @@ -import { useQuery, gql } from "@apollo/client"; -import { makeStyles } from '@mui/styles' +import { useQuery, gql } from '@apollo/client' import * as R from 'ramda' import React from 'react' -// import * as Yup from 'yup' -// import { Link, IconButton } from 'src/components/buttons' -// import { TextInput } from 'src/components/inputs' import DataTable from 'src/components/tables/DataTable' import TxInIcon from 'src/styling/icons/direction/cash-in.svg?react' import TxOutIcon from 'src/styling/icons/direction/cash-out.svg?react' import { NumberInput } from 'src/components/inputs/formik' -// import EditIconDisabled from 'src/styling/icons/action/edit/disabled.svg?react' -// import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react' import { formatDate } from 'src/utils/timezones' const GET_BATCHES = gql` @@ -29,55 +23,9 @@ const GET_BATCHES = gql` } ` -/* const EDIT_BATCH = gql` - mutation editBatch($id: ID, $performedBy: String) { - editBatch(id: $id, performedBy: $performedBy) { - id - } - } -` */ - -const styles = { - operationType: { - marginLeft: 8 - }, - operationTypeWrapper: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center' - }, - saveAndCancel: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'space-between' - }, - tableWrapper: { - display: 'flex', - flexDirection: 'column', - flex: 1, - marginBottom: 80 - } -} - -/* const schema = Yup.object().shape({ - performedBy: Yup.string().nullable() -}) */ - -const useStyles = makeStyles(styles) - const CashboxHistory = ({ machines, currency, timezone }) => { - const classes = useStyles() - - /* const [error, setError] = useState(false) - const [field, setField] = useState(null) - const [editing, setEditing] = useState(false) */ - const { data: batchesData, loading: batchesLoading } = useQuery(GET_BATCHES) - /* const [editBatch] = useMutation(EDIT_BATCH, { - refetchQueries: () => ['cashboxBatches'] - }) */ - const loading = batchesLoading const batches = R.path(['cashboxBatches'])(batchesData) @@ -89,18 +37,14 @@ const CashboxHistory = ({ machines, currency, timezone }) => { `cash-cassette-${i}-refill`, <> - - Cash cassette {i} refill - + Cash cassette {i} refill ), R.assoc( `cash-cassette-${i}-empty`, <> - - Cash cassette {i} emptied - + Cash cassette {i} emptied ) )(ret), @@ -108,35 +52,13 @@ const CashboxHistory = ({ machines, currency, timezone }) => { 'cash-box-empty': ( <> - Cash box emptied + Cash box emptied ) }, R.range(1, 5) ) - /* const save = row => { - const performedBy = field.performedBy === '' ? null : field.performedBy - - schema - .isValid(field) - .then(() => { - setError(false) - editBatch({ - variables: { id: row.id, performedBy: performedBy } - }) - }) - .catch(setError(true)) - return close() - } - - const close = () => { - setEditing(false) - setField(null) - } - - const notEditing = id => field?.id !== id */ - const elements = [ { name: 'operation', @@ -144,7 +66,7 @@ const CashboxHistory = ({ machines, currency, timezone }) => { width: 200, textAlign: 'left', view: it => ( -
+
{getOperationRender[it.operationType]}
) @@ -198,57 +120,10 @@ const CashboxHistory = ({ machines, currency, timezone }) => { textAlign: 'right', view: it => formatDate(it.created, timezone, 'HH:mm') } - /* { - name: 'performedBy', - header: 'Performed by', - width: 180, - textAlign: 'left', - view: it => { - if (notEditing(it.id)) - return R.isNil(it.performedBy) ? 'Unknown entity' : it.performedBy - return ( - setField({ ...field, performedBy: e.target.value })} - error={error} - width={190 * 0.85} - value={field?.performedBy} - /> - ) - } - }, - { - name: '', - header: 'Edit', - width: 80, - textAlign: 'right', - view: it => { - if (notEditing(it.id)) - return ( - { - setField({ id: it.id, performedBy: it.performedBy }) - setEditing(true) - }}> - {editing ? : } - - ) - return ( -
- save(it)}> - Save - - - Cancel - -
- ) - } - } */ ] return ( -
+
-// supportArtices.find(({ code: article }) => article === status) - -const useLStyles = makeStyles(labelStyles) - const Label = ({ children }) => { - const classes = useLStyles() - - return
{children}
+ return {children} } -const useMDStyles = makeStyles(machineDetailsStyles) - -const Container = ({ children, ...props }) => ( - - {children} - -) - -const Item = ({ children, ...props }) => ( - - {children} - -) - const MachineDetailsRow = ({ it: machine, onActionSuccess, timezone }) => { - const classes = useMDStyles() - return ( - - {/* - - - -
    - {machine.statuses.map((status, index) => ( -
  • - -
  • - ))} -
-
- - -
    - {machine.statuses - .map(article) - .map(({ label, article }, index) => ( -
  • - - '{label}' - -
  • - ))} -
-
-
-
- */} - - - - - {modelPrettifier[machine.model]} - - - - - {timezone && - formatDate(machine.pairedAt, timezone, 'yyyy-MM-dd HH:mm:ss')} - - - - - - - - - {machine.downloadSpeed - ? new BigNumber(machine.downloadSpeed).toFixed(4).toString() + - ' MB/s' - : 'unavailable'} - - - - - - {machine.responseTime - ? new BigNumber(machine.responseTime).toFixed(3).toString() + - ' ms' - : 'unavailable'} - - - - - - {machine.packetLoss - ? new BigNumber(machine.packetLoss).toFixed(3).toString() + - ' %' - : 'unavailable'} - - - - -
+
+
+ + {modelPrettifier[machine.model]} +
+
+ + + {timezone && + formatDate(machine.pairedAt, timezone, 'yyyy-MM-dd HH:mm:ss')} + +
+
+ +
+
+ + + {machine.downloadSpeed + ? new BigNumber(machine.downloadSpeed).toFixed(4).toString() + + ' MB/s' + : 'unavailable'} + +
+
+ + + {machine.responseTime + ? new BigNumber(machine.responseTime).toFixed(3).toString() + ' ms' + : 'unavailable'} + +
+
+ + + {machine.packetLoss + ? new BigNumber(machine.packetLoss).toFixed(3).toString() + ' %' + : 'unavailable'} + +
+
) } diff --git a/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.styles.js b/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.styles.js deleted file mode 100644 index 7ac4426f..00000000 --- a/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.styles.js +++ /dev/null @@ -1,47 +0,0 @@ -import { alpha } from '@mui/material/styles' - -import { - detailsRowStyles, - labelStyles -} from 'src/pages/Transactions/Transactions.styles' -import { spacer, comet, primaryColor, fontSize4 } from 'src/styling/variables' - -const machineDetailsStyles = { - ...detailsRowStyles, - wrapper: { - display: 'flex', - // marginTop: 24, - // marginBottom: 32, - marginTop: 12, - marginBottom: 16, - fontSize: fontSize4 - }, - row: { - display: 'flex', - flexDirection: 'row' - // marginBottom: 36 - }, - list: { - padding: 0, - margin: 0, - listStyle: 'none' - }, - item: { - height: spacer * 3, - marginBottom: spacer * 1.5 - }, - link: { - color: primaryColor, - textDecoration: 'none' - }, - separator: { - width: 1, - height: 170, - zIndex: 1, - marginRight: 60, - marginLeft: 'auto', - background: alpha(comet, 0.5) - } -} - -export { labelStyles, machineDetailsStyles } diff --git a/new-lamassu-admin/src/pages/Maintenance/MachineStatus.jsx b/new-lamassu-admin/src/pages/Maintenance/MachineStatus.jsx index 3b0abdc4..34eea6d3 100644 --- a/new-lamassu-admin/src/pages/Maintenance/MachineStatus.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/MachineStatus.jsx @@ -1,5 +1,4 @@ -import { useQuery, gql } from "@apollo/client"; -import { makeStyles } from '@mui/styles' +import { useQuery, gql } from '@apollo/client' import { formatDistance } from 'date-fns' import * as R from 'ramda' import React from 'react' @@ -7,12 +6,11 @@ import { useHistory, useLocation } from 'react-router-dom' import { MainStatus } from 'src/components/Status' import Title from 'src/components/Title' import DataTable from 'src/components/tables/DataTable' +import { Label1 } from 'src/components/typography/index.jsx' import MachineRedirectIcon from 'src/styling/icons/month arrows/right.svg?react' import WarningIcon from 'src/styling/icons/status/pumpkin.svg?react' import ErrorIcon from 'src/styling/icons/status/tomato.svg?react' -import { mainStyles } from 'src/pages/Transactions/Transactions.styles' - import MachineDetailsRow from './MachineDetailsCard' const GET_MACHINES = gql` @@ -56,10 +54,7 @@ const GET_DATA = gql` } ` -const useStyles = makeStyles(mainStyles) - const MachineStatus = () => { - const classes = useStyles() const history = useHistory() const { state } = useLocation() const addedMachineId = state?.id @@ -78,10 +73,9 @@ const MachineStatus = () => { size: 'sm', textAlign: 'left', view: m => ( -
+
{m.name}
{ history.push(`/machines/${m.deviceId}`) }}> @@ -131,18 +125,16 @@ const MachineStatus = () => { return ( <> -
-
- Machine status -
-
-
+
+ Machine status +
+
- Warning + Warning
-
+
- Error + Error
diff --git a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.jsx b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.jsx index 921e189b..3693cff4 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.jsx @@ -1,77 +1,35 @@ -import { makeStyles } from '@mui/styles' import React from 'react' import { H1, P, Info2 } from 'src/components/typography' import WarningIcon from 'src/styling/icons/warning-icon/comet.svg?react' import { Button } from 'src/components/buttons' import filledCassettes from 'src/styling/icons/cassettes/both-filled.svg' -import { comet } from 'src/styling/variables' - -const styles = { - button: { - margin: [[35, 'auto', 0, 'auto']] - }, - modalContent: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - flex: 1, - padding: [[0, 34]] - }, - splashTitle: { - marginTop: 15 - }, - warningInfo: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - marginTop: 15 - }, - warningIcon: { - width: 25, - height: 25, - marginRight: 8, - display: 'block' - }, - warningText: { - flexBasis: '100%', - flexGrow: 1 - }, - machineName: { - margin: [[5, 0]], - color: comet - } -} - -const useStyles = makeStyles(styles) const WizardSplash = ({ name, onContinue }) => { - const classes = useStyles() - return ( -
+
cassette -

- Update counts -

- - {name} - -
- -

+

+

Update counts

+ + {name} + +
+
+ +

Before updating counts on Lamassu Admin, make sure you've done it before on the machines.

-
- -

+

+ +

For cash cassettes, please make sure you've removed the remaining bills before adding the new ones.

-
diff --git a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.jsx b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.jsx index 42186e38..51007534 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.jsx +++ b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.jsx @@ -1,4 +1,3 @@ -import { makeStyles } from '@mui/styles' import classnames from 'classnames' import { Formik, Form, Field } from 'formik' import * as R from 'ramda' @@ -22,89 +21,10 @@ import tejo4CassetteOne from 'src/styling/icons/cassettes/tejo/4-cassettes/4-cas import tejo4CassetteTwo from 'src/styling/icons/cassettes/tejo/4-cassettes/4-cassettes-open-2-left.svg' import tejo4CassetteThree from 'src/styling/icons/cassettes/tejo/4-cassettes/4-cassettes-open-3-left.svg' import tejo4CassetteFour from 'src/styling/icons/cassettes/tejo/4-cassettes/4-cassettes-open-4-left.svg' -import { comet, errorColor } from 'src/styling/variables' import { getCashUnitCapacity } from 'src/utils/machine' import { numberToFiatAmount } from 'src/utils/number' import { startCase } from 'src/utils/string' - -const styles = { - content: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'space-between', - flex: 1, - paddingBottom: 32 - }, - titleDiv: { - marginBottom: 32 - }, - title: { - margin: [[0, 0, 12, 0]], - color: comet - }, - stepImage: { - width: 148, - height: 196 - }, - form: { - paddingBottom: 95 - }, - verticalAlign: { - display: 'flex', - flexDirection: 'column' - }, - horizontalAlign: { - display: 'flex', - flexDirection: 'row' - }, - centerAlignment: { - alignItems: 'center' - }, - lineAlignment: { - alignItems: 'baseline' - }, - fullWidth: { - margin: [[0, 'auto']], - flexBasis: 'auto' - }, - formWrapper: { - flexBasis: '100%', - display: 'flex', - justifyContent: 'center' - }, - submit: { - float: 'right' - }, - cashboxBills: { - marginRight: 5 - }, - cassetteCashbox: { - width: 40, - height: 35 - }, - cassetteFormTitle: { - marginTop: 18 - }, - cassetteFormTitleContent: { - marginLeft: 10, - marginRight: 25 - }, - smBottomMargin: { - marginBottom: 25 - }, - fiatTotal: { - color: comet - }, - errorMessage: { - color: errorColor - }, - stepErrorMessage: { - maxWidth: 275, - marginTop: 25 - } -} - -const useStyles = makeStyles(styles) +import classes from './WizardStep.module.css' const CASHBOX_STEP = 1 @@ -171,8 +91,6 @@ const WizardStep = ({ onContinue, initialValues }) => { - const classes = useStyles() - const label = lastStep ? 'Finish' : 'Confirm' const stepOneRadioOptions = [ @@ -197,9 +115,11 @@ const WizardStep = ({ ) return ( -
-
- {name} +
+
+ + {name} +
@@ -212,19 +132,14 @@ const WizardStep = ({ enableReinitialize validationSchema={steps[0].schema}> {({ errors }) => ( -
-
+ +
{cashUnitCategory}
-
+

Did you empty the cash box?

{errors.wasCashboxEmptied && ( -
+
{errors.wasCashboxEmptied}
)}

Since previous update

@@ -253,9 +168,9 @@ const WizardStep = ({
- + {machine?.cashUnits.cashbox}

accepted bills

@@ -263,7 +178,7 @@ const WizardStep = ({
- @@ -280,9 +195,8 @@ const WizardStep = ({ enableReinitialize validationSchema={steps[step - 1].schema}> {({ values, errors }) => ( -
-
+ +
{cashUnitCategory}
-
+
+ className={classnames(classes.horizontalAlign, 'mb-6')}>
+ className={classnames(classes.horizontalAlign, 'mt-4')}> -

+

{startCase(cashUnitField)} ( {cashUnitCategory === 'cassette' ? `dispenser` @@ -321,7 +223,7 @@ const WizardStep = ({

@@ -330,7 +232,7 @@ const WizardStep = ({

{cashUnitDenomination} {fiatCurrency} bills loaded

-

+

= {numberToFiatAmount(cassetteTotal(values))}{' '} {fiatCurrency}

{!R.isEmpty(errors) && ( - + {R.head(R.values(errors))} )}
- diff --git a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.module.css b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.module.css new file mode 100644 index 00000000..2d5a96de --- /dev/null +++ b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.module.css @@ -0,0 +1,22 @@ +.stepImage { + width: 148px; + height: 196px; +} + +.formWrapper { + flex-basis: 100%; + display: flex; + justify-content: center; +} + +.verticalAlign { + display: flex; + flex-direction: column; + margin: 0 auto; + flex-basis: auto; +} + +.horizontalAlign { + display: flex; + flex-direction: row; +}