diff --git a/new-lamassu-admin/src/components/CollapsibleCard.jsx b/new-lamassu-admin/src/components/CollapsibleCard.jsx index eeec8527..987c32e7 100644 --- a/new-lamassu-admin/src/components/CollapsibleCard.jsx +++ b/new-lamassu-admin/src/components/CollapsibleCard.jsx @@ -1,10 +1,8 @@ -import Grid from '@mui/material/Grid' -import { makeStyles } from '@mui/styles' -import classnames from 'classnames' import PropTypes from 'prop-types' import React from 'react' -import { white } from 'src/styling/variables' +import Paper from '@mui/material/Paper' +import classnames from 'classnames' const cardState = Object.freeze({ DEFAULT: 'default', @@ -12,24 +10,11 @@ const cardState = Object.freeze({ EXPANDED: 'expanded' }) -const styles = { - card: { - wordWrap: 'break-word', - boxShadow: '0 0 4px 0 rgba(0, 0, 0, 0.08)', - borderRadius: 12, - padding: 24, - backgroundColor: white - } -} - -const useStyles = makeStyles(styles) - const CollapsibleCard = ({ className, state, shrunkComponent, children }) => { - const classes = useStyles() return ( - + {state === cardState.SHRUNK ? shrunkComponent : children} - + ) } diff --git a/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.jsx b/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.jsx index 17b89f2f..bb88d73f 100644 --- a/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.jsx +++ b/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.jsx @@ -1,14 +1,12 @@ -import { useQuery, gql } from "@apollo/client"; +import { useQuery, gql } from '@apollo/client' import Button from '@mui/material/Button' import Grid from '@mui/material/Grid' -import { makeStyles } from '@mui/styles' import classnames from 'classnames' import * as R from 'ramda' import React from 'react' import { cardState } from 'src/components/CollapsibleCard' import { Label1, H4 } from 'src/components/typography' -import styles from './Alerts.styles' import AlertsTable from './AlertsTable' const NUM_TO_RENDER = 3 @@ -31,10 +29,7 @@ const GET_ALERTS = gql` } ` -const useStyles = makeStyles(styles) - const Alerts = ({ onReset, onExpand, size }) => { - const classes = useStyles() const showAllItems = size === cardState.EXPANDED const { data } = useQuery(GET_ALERTS) const alerts = R.path(['alerts'])(data) ?? [] @@ -44,35 +39,30 @@ const Alerts = ({ onReset, onExpand, size }) => { )(data?.machines ?? []) const alertsLength = alerts.length - const alertsTableContainerClasses = { - [classes.alertsTableContainer]: !showAllItems, - [classes.expandedAlertsTableContainer]: showAllItems - } - return ( <> -
-

{`Alerts (${alertsLength})`}

+
+

{`Alerts (${alertsLength})`}

{showAllItems && ( - + )}
{!alerts.length && ( - + No new alerts. Your system is running smoothly. )} @@ -85,13 +75,13 @@ const Alerts = ({ onReset, onExpand, size }) => { {!showAllItems && alertsLength > NUM_TO_RENDER && ( - + diff --git a/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.styles.js b/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.styles.js deleted file mode 100644 index eb188b65..00000000 --- a/new-lamassu-admin/src/pages/Dashboard/Alerts/Alerts.styles.js +++ /dev/null @@ -1,57 +0,0 @@ -import { primaryColor, comet } from 'src/styling/variables' - -const styles = { - container: { - display: 'flex', - justifyContent: 'space-between' - }, - h4: { - margin: 0, - marginBottom: 10 - }, - centerLabel: { - marginBottom: 0, - padding: 0, - textAlign: 'center' - }, - upperButtonLabel: { - marginTop: -3, - marginBottom: 24 - }, - button: { - color: primaryColor, - marginTop: 0, - minHeight: 0, - minWidth: 0, - padding: 0, - textTransform: 'none', - '&:hover': { - backgroundColor: 'transparent' - } - }, - alertsTableContainer: { - margin: 0 - }, - expandedAlertsTableContainer: { - margin: 0, - maxHeight: 460 - }, - noAlertsLabel: { - color: comet, - marginLeft: -5, - height: 100 - }, - table: { - maxHeight: 465, - overflowX: 'hidden', - overflowY: 'auto' - }, - listItemText: { - margin: '8px 0 8px 0' - }, - linkIcon: { - marginLeft: 'auto', - cursor: 'pointer' - } -} -export default styles diff --git a/new-lamassu-admin/src/pages/Dashboard/Alerts/AlertsTable.jsx b/new-lamassu-admin/src/pages/Dashboard/Alerts/AlertsTable.jsx index 478b0876..604a2992 100644 --- a/new-lamassu-admin/src/pages/Dashboard/Alerts/AlertsTable.jsx +++ b/new-lamassu-admin/src/pages/Dashboard/Alerts/AlertsTable.jsx @@ -1,4 +1,3 @@ -import { makeStyles } from '@mui/styles' import List from '@mui/material/List' import ListItem from '@mui/material/ListItem' import * as R from 'ramda' @@ -10,9 +9,6 @@ import CashBoxEmpty from 'src/styling/icons/cassettes/cashbox-empty.svg?react' import AlertLinkIcon from 'src/styling/icons/month arrows/right.svg?react' import WarningIcon from 'src/styling/icons/warning-icon/tomato.svg?react' -import styles from './Alerts.styles' -const useStyles = makeStyles(styles) - const icons = { error: , fiatBalance: ( @@ -28,7 +24,6 @@ const links = { const AlertsTable = ({ numToRender, alerts, machines }) => { const history = useHistory() - const classes = useStyles() const alertsToRender = R.slice(0, numToRender, alerts) const alertMessage = alert => { @@ -40,16 +35,16 @@ const AlertsTable = ({ numToRender, alerts, machines }) => { } return ( - + {alertsToRender.map((alert, idx) => { return ( {icons[alert.type] || ( )} -

{alertMessage(alert)}

+

{alertMessage(alert)}

history.push(links[alert.type] || '/dashboard')} />
diff --git a/new-lamassu-admin/src/pages/Dashboard/Dashboard.jsx b/new-lamassu-admin/src/pages/Dashboard/Dashboard.jsx index e3b7eb07..3814d5bc 100644 --- a/new-lamassu-admin/src/pages/Dashboard/Dashboard.jsx +++ b/new-lamassu-admin/src/pages/Dashboard/Dashboard.jsx @@ -1,6 +1,4 @@ -import { useQuery, gql } from "@apollo/client"; -import Grid from '@mui/material/Grid' -import { makeStyles } from '@mui/styles' +import { useQuery, gql } from '@apollo/client' import * as R from 'ramda' import React, { useState } from 'react' import { useHistory } from 'react-router-dom' @@ -13,11 +11,10 @@ import { Button } from 'src/components/buttons' import AddMachine from 'src/pages/AddMachine' import { errorColor } from 'src/styling/variables' -import styles from './Dashboard.styles' import Footer from './Footer' -import LeftSide from './LeftSide' import RightSide from './RightSide' -const useStyles = makeStyles(styles) +import Paper from '@mui/material/Paper' +import SystemPerformance from './SystemPerformance/index.js' const GET_DATA = gql` query getData { @@ -30,7 +27,6 @@ const GET_DATA = gql` const Dashboard = () => { const history = useHistory() - const classes = useStyles() const [open, setOpen] = useState(false) const { data, loading } = useQuery(GET_DATA) @@ -44,16 +40,16 @@ const Dashboard = () => { !R.isEmpty(data.machines) ? ( <> -
-
+
+
Cash-in
-
+
Cash-out
-
+
@@ -61,15 +57,15 @@ const Dashboard = () => {
-
- - - - - - - - +
+
+ + + +
+
+ +