diff --git a/lib/new-admin/graphql/schema.js b/lib/new-admin/graphql/schema.js index 8cfcffff..3f322338 100644 --- a/lib/new-admin/graphql/schema.js +++ b/lib/new-admin/graphql/schema.js @@ -356,8 +356,8 @@ const resolvers = { serverLogs.getServerLogs(from, until, limit, offset), serverLogsCsv: (...[, { from, until, limit, offset }]) => serverLogs.getServerLogs(from, until, limit, offset).then(parseAsync), - transactions: (...[, { from, until, limit, offset }]) => - transactions.batch(from, until, limit, offset), + transactions: (...[, { from, until, limit, offset, id }]) => + transactions.batch(from, until, limit, offset, id), transactionsCsv: (...[, { from, until, limit, offset }]) => transactions.batch(from, until, limit, offset).then(parseAsync), config: () => settingsLoader.loadLatestConfigOrNone(), diff --git a/new-lamassu-admin/src/components/typography/index.js b/new-lamassu-admin/src/components/typography/index.js index a9681372..2cd0a09e 100644 --- a/new-lamassu-admin/src/components/typography/index.js +++ b/new-lamassu-admin/src/components/typography/index.js @@ -91,7 +91,6 @@ const TL2 = pBuilder('tl2') const Label1 = pBuilder('label1') const Label2 = pBuilder('label2') const Label3 = pBuilder('label3') -const Label4 = pBuilder('regularLabel') function pBuilder(elementClass) { return ({ inline, noMargin, className, children, ...props }) => { @@ -125,6 +124,5 @@ export { Mono, Label1, Label2, - Label3, - Label4 + Label3 } diff --git a/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js b/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js index 7a62ca5b..b78fc010 100644 --- a/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js +++ b/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js @@ -1,13 +1,15 @@ import { useQuery } from '@apollo/react-hooks' import { makeStyles } from '@material-ui/core' +import Button from '@material-ui/core/Button' import Grid from '@material-ui/core/Grid' import gql from 'graphql-tag' import * as R from 'ramda' -import React from 'react' +import React, { useState, useEffect } from 'react' -import { Label2 } from 'src/components/typography' +import { Label1, Label2 } from 'src/components/typography' import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg' import { ReactComponent as TxOutIcon } from 'src/styling/icons/direction/cash-out.svg' +import { white } from 'src/styling/variables' import { fromNamespace } from 'src/utils/config' import styles from './Footer.styles' @@ -29,8 +31,32 @@ const GET_DATA = gql` const useStyles = makeStyles(styles) const Footer = () => { const { data, loading } = useQuery(GET_DATA) - + const [expanded, setExpanded] = useState(false) + const [showExpandBtn, setShowExpandBtn] = useState(false) + const [buttonName, setButtonName] = useState('Show all') const classes = useStyles() + + useEffect(() => { + if (data && data.rates && data.rates.withCommissions) { + const numItems = R.keys(data.rates.withCommissions).length + if (numItems > 4) { + setShowExpandBtn(true) + setButtonName(`Show all (${numItems})`) + } + } + }, [data]) + + const toggleExpand = () => { + if (expanded) { + const numItems = R.keys(data.rates.withCommissions).length + setExpanded(false) + setButtonName(`Show all (${numItems})`) + } else { + setExpanded(true) + setButtonName(`Show less`) + } + } + const wallets = fromNamespace('wallets')(data?.config) const renderFooterItem = key => { @@ -99,15 +125,54 @@ const Footer = () => { ) } + const makeFooterExpandedClass = () => { + return { + overflow: 'scroll', + // 88px for base height, then add 100 px for each row of items. Each row has 4 items. 5 items makes 2 rows so 288px of height + height: + 88 + Math.ceil(R.keys(data.rates.withCommissions).length / 4) * 100, + maxHeight: '50vh', + position: 'fixed', + left: 0, + bottom: 0, + width: '100vw', + backgroundColor: white, + textAlign: 'left', + boxShadow: '0px -1px 10px 0px rgba(50, 50, 50, 0.1)' + } + } + return ( <> -
{data.model}
*/} -{data.model}
-{data.version}
-{data.pairedAt ? moment(data.pairedAt).format('YYYY-MM-DD HH:mm:ss') @@ -77,68 +22,15 @@ const Details = ({ data, onActionSuccess }) => {
- {data.lastPing - ? moment(data.lastPing).format('YYYY-MM-DD HH:mm:ss') - : ''} -
+{data.model}
{data.version}
{data.lastPing ? makeLastPing() : ''}
+