+
{
onFocus={() => setError(null)}
/>
-
+
{
/>
{editing && !!getErrorMsg(errors) && (
-
- {getErrorMsg(errors)}
-
+
{getErrorMsg(errors)}
+ )}
+ {editing && (
+
+
+ Save
+
+
+ Cancel
+
+ {error && Failed to save changes}
+
)}
-
- {editing && (
- <>
-
- Save
-
-
- Cancel
-
- {error && (
- Failed to save changes
- )}
- >
- )}
-
)}
{!wizard && (
-
-
-
+ <>
+
Sharing your information with your customers through your machines
allows them to contact you in case there's a problem with a machine
in your network or a transaction.
-
-
+
+ >
)}
>
- );
+ )
}
export default ContactInfo
diff --git a/new-lamassu-admin/src/pages/OperatorInfo/MachineScreens.jsx b/new-lamassu-admin/src/pages/OperatorInfo/MachineScreens.jsx
index d66ed288..6a66f783 100644
--- a/new-lamassu-admin/src/pages/OperatorInfo/MachineScreens.jsx
+++ b/new-lamassu-admin/src/pages/OperatorInfo/MachineScreens.jsx
@@ -1,15 +1,11 @@
-import { useQuery, useMutation, gql } from "@apollo/client";
-import { makeStyles } from '@mui/styles'
-import Switch from '@mui/material/Switch'
+import { useQuery, useMutation, gql } from '@apollo/client'
import * as R from 'ramda'
import React, { memo } from 'react'
-import { H4, P, Label2 } from 'src/components/typography'
+import { H4 } from 'src/components/typography'
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
-import { global } from './OperatorInfo.styles'
-
-const useStyles = makeStyles(global)
+import SwitchRow from './components/SwitchRow.jsx'
const GET_CONFIG = gql`
query getData {
@@ -24,14 +20,26 @@ const SAVE_CONFIG = gql`
`
const MachineScreens = memo(({ wizard }) => {
- const classes = useStyles()
-
const { data } = useQuery(GET_CONFIG)
const [saveConfig] = useMutation(SAVE_CONFIG, {
refetchQueries: () => ['getData']
})
+ const save = it => {
+ const formatConfig = R.compose(
+ toNamespace(namespaces.MACHINE_SCREENS),
+ toNamespace('rates'),
+ R.mergeRight(ratesScreenConfig)
+ )
+
+ return saveConfig({
+ variables: {
+ config: formatConfig({ active: it })
+ }
+ })
+ }
+
const machineScreensConfig =
data?.config && fromNamespace(namespaces.MACHINE_SCREENS, data.config)
@@ -46,32 +54,12 @@ const MachineScreens = memo(({ wizard }) => {
return (
<>
-
-
Rates screen
-
-
-
Enable rates screen
-
-
- saveConfig({
- variables: {
- config: R.compose(
- toNamespace(namespaces.MACHINE_SCREENS),
- toNamespace('rates')
- )(
- R.merge(ratesScreenConfig, {
- active: event.target.checked
- })
- )
- }
- })
- }
- />
- {ratesScreenConfig.active ? 'Yes' : 'No'}
-
-
+
Rates screen
+
>
)
})
diff --git a/new-lamassu-admin/src/pages/OperatorInfo/OperatorInfo.styles.js b/new-lamassu-admin/src/pages/OperatorInfo/OperatorInfo.styles.js
deleted file mode 100644
index 9bdfe706..00000000
--- a/new-lamassu-admin/src/pages/OperatorInfo/OperatorInfo.styles.js
+++ /dev/null
@@ -1,118 +0,0 @@
-import { offColor } from 'src/styling/variables'
-
-const global = {
- content: {
- display: 'flex'
- },
- header: {
- display: 'flex',
- alignItems: 'center',
- position: 'relative',
- flex: 'wrap'
- },
- section: {
- marginBottom: 52
- },
- row: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- marginBottom: 28,
- width: 600,
- '&:last-child': {
- marginBottom: 0
- }
- },
- switchRow: {
- display: 'flex',
- alignItems: 'center',
- position: 'relative',
- flex: 'wrap',
- justifyContent: 'space-between',
- width: 396
- },
- switch: {
- display: 'flex',
- alignItems: 'center'
- },
- submit: {
- justifyContent: 'flex-start',
- alignItems: 'center',
- padding: [[0, 4, 4, 4]],
- '& > button': {
- marginRight: 40
- }
- },
- transparentButton: {
- '& > *': {
- margin: 'auto 12px'
- },
- '& button': {
- border: 'none',
- backgroundColor: 'transparent',
- cursor: 'pointer'
- }
- },
- infoMessage: {
- display: 'flex',
- marginBottom: 52,
- '& > p': {
- width: 330,
- color: offColor,
- marginTop: 4,
- marginLeft: 16
- }
- },
- formErrorMsg: {
- margin: [[0, 0, 20, 0]]
- }
-}
-
-const fieldStyles = {
- field: {
- position: 'relative',
- width: 280,
- padding: [[0, 4, 4, 0]]
- },
- notEditing: {
- display: 'flex',
- flexDirection: 'column'
- },
- notEditingSingleLine: {
- '& > p:first-child': {
- height: 16,
- lineHeight: '16px',
- transform: 'scale(0.75)',
- transformOrigin: 'left',
- paddingLeft: 0,
- margin: [[1, 0, 6, 0]]
- },
- '& > p:last-child': {
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- height: 25,
- margin: 0
- }
- },
- notEditingMultiline: {
- '& > p:first-child': {
- height: 16,
- lineHeight: '16px',
- transform: 'scale(0.75)',
- transformOrigin: 'left',
- paddingLeft: 0,
- margin: [[1, 0, 5, 0]]
- },
- '& > p:last-child': {
- width: 502,
- height: 121,
- overflowY: 'auto',
- lineHeight: '19px',
- wordWrap: 'anywhere',
- margin: 0
- }
- }
-}
-
-export { global, fieldStyles }
diff --git a/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting.jsx b/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting.jsx
index 3d22330e..4f0209d9 100644
--- a/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting.jsx
+++ b/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting.jsx
@@ -1,19 +1,12 @@
-import { useQuery, useMutation, gql } from "@apollo/client";
-import { makeStyles } from '@mui/styles'
-import Switch from '@mui/material/Switch'
+import { useQuery, useMutation, gql } from '@apollo/client'
import * as R from 'ramda'
import React, { memo } from 'react'
-import { HelpTooltip } from 'src/components/Tooltip'
-import { H4, P, Label2 } from 'src/components/typography'
import { BooleanPropertiesTable } from 'src/components/booleanPropertiesTable'
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
-import { SupportLinkButton } from '../../components/buttons'
-
-import { global } from './OperatorInfo.styles'
-
-const useStyles = makeStyles(global)
+import Header from './components/Header.jsx'
+import SwitchRow from './components/SwitchRow.jsx'
const GET_CONFIG = gql`
query getData {
@@ -28,14 +21,23 @@ const SAVE_CONFIG = gql`
`
const ReceiptPrinting = memo(({ wizard }) => {
- const classes = useStyles()
-
const { data } = useQuery(GET_CONFIG)
const [saveConfig] = useMutation(SAVE_CONFIG, {
refetchQueries: () => ['getData']
})
+ const saveSwitch = object => {
+ return saveConfig({
+ variables: {
+ config: toNamespace(
+ namespaces.RECEIPT,
+ R.mergeRight(receiptPrintingConfig, object)
+ )
+ }
+ })
+ }
+
const save = it =>
saveConfig({
variables: { config: toNamespace(namespaces.RECEIPT, it) }
@@ -47,84 +49,26 @@ const ReceiptPrinting = memo(({ wizard }) => {
return (
<>
-
-
Receipt options
-
-
- For details on configuring this panel, please read the relevant
- knowledgebase article:
-
-
-
-
-
-
Enable receipt printing
-
-
- saveConfig({
- variables: {
- config: toNamespace(
- namespaces.RECEIPT,
- R.merge(receiptPrintingConfig, {
- active: event.target.checked
- })
- )
- }
- })
- }
- />
- {receiptPrintingConfig.active ? 'Yes' : 'No'}
-
-
-
-
Automatic receipt printing
-
-
- saveConfig({
- variables: {
- config: toNamespace(
- namespaces.RECEIPT,
- R.merge(receiptPrintingConfig, {
- automaticPrint: event.target.checked
- })
- )
- }
- })
- }
- />
- {receiptPrintingConfig.automaticPrint ? 'Yes' : 'No'}
-
-
-
-
Offer SMS receipt
-
-
- saveConfig({
- variables: {
- config: toNamespace(
- namespaces.RECEIPT,
- R.merge(receiptPrintingConfig, {
- sms: event.target.checked
- })
- )
- }
- })
- }
- />
- {receiptPrintingConfig.sms ? 'Yes' : 'No'}
-
-
+
+
saveSwitch({ active: it })}
+ />
+ saveSwitch({ automaticPrint: it })}
+ />
+ saveSwitch({ sms: it })}
+ />
{
- const classes = useFieldStyles()
-
- const classNames = {
- [classes.field]: true,
- [classes.notEditing]: !editing,
- [classes.notEditingSingleLine]: !editing && !multiline,
- [classes.notEditingMultiline]: !editing && multiline
+ const info3ClassNames = {
+ 'overflow-hidden whitespace-nowrap text-ellipsis h-6': !multiline,
+ 'wrap-anywhere overflow-y-auto h-32 mt-4 leading-[23px]': multiline
}
return (
-
+
{!editing && (
<>
-
{label}
-
{value}
+
+ {label}
+
+
+ {value}
+
>
)}
{editing && (
@@ -81,8 +77,6 @@ const SAVE_CONFIG = gql`
}
`
-const useTermsConditionsStyles = makeStyles(global)
-
const TermsConditions = () => {
const [error, setError] = useState(null)
const [editing, setEditing] = useState(false)
@@ -95,8 +89,6 @@ const TermsConditions = () => {
onError: e => setError(e)
})
- const classes = useTermsConditionsStyles()
-
const { data } = useQuery(GET_CONFIG)
const termsAndConditions =
@@ -169,72 +161,30 @@ const TermsConditions = () => {
return (
<>
-
-
Terms & Conditions
-
-
- For details on configuring this panel, please read the relevant
- knowledgebase article:
-
-
-
-
-
-
Show on screen
-
-
- save({
- active: event.target.checked
- })
- }
- />
- {showOnScreen ? 'Yes' : 'No'}
-
-
-
-
- Capture customer photo on acceptance
of Terms & Conditions
- screen
-
-
-
- save({
- tcPhoto: event.target.checked
- })
- }
- />
- {tcPhoto ? 'Yes' : 'No'}
-
-
-
-
Add 7 seconds delay on screen
-
-
- save({
- delay: event.target.checked
- })
- }
- />
- {addDelayOnScreen ? 'Yes' : 'No'}
-
-
-
+
+
save({ active: it })}
+ />
+ save({ tcPhoto: it })}
+ />
+ save({ delay: it })}
+ />
+
Info card
{!editing && (
-
setEditing(true)}
- size="large">
+ setEditing(true)} size="large">
)}
@@ -251,10 +201,10 @@ const TermsConditions = () => {
setError(null)
}}>
{({ errors }) => (
-