diff --git a/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js b/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js index 244a4bc1..8847c950 100644 --- a/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js +++ b/new-lamassu-admin/src/pages/Dashboard/Footer/Footer.js @@ -62,26 +62,19 @@ const Footer = () => { const avgOfAskBid = new BigNumber( (cashInNoCommission + cashOutNoCommission) / 2 - ) - .decimalPlaces(2) - .toNumber() + ).toFormat(2) const cashIn = new BigNumber( parseFloat( R.path(['cryptoRates', 'withCommissions', key, 'cashIn'])(data) ) - ) - .decimalPlaces(2) - .toNumber() + ).toFormat(2) const cashOut = new BigNumber( parseFloat( R.path(['cryptoRates', 'withCommissions', key, 'cashOut'])(data) ) - ) - .decimalPlaces(2) - .toNumber() + ).toFormat(2) const localeFiatCurrency = data.config.locale_fiatCurrency - const localeLanguage = data.config.locale_languages[0] return ( @@ -91,23 +84,17 @@ const Footer = () => {
- {` ${cashIn.toLocaleString( - localeLanguage - )} ${localeFiatCurrency}`} + {` ${cashIn} ${localeFiatCurrency}`}
- {` ${cashOut.toLocaleString( - localeLanguage - )} ${localeFiatCurrency}`} + {` ${cashOut} ${localeFiatCurrency}`}
{`${tickerName}: ${avgOfAskBid.toLocaleString( - localeLanguage - )} ${localeFiatCurrency}`} + }>{`${tickerName}: ${avgOfAskBid} ${localeFiatCurrency}`}
) } diff --git a/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/SystemPerformance.js b/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/SystemPerformance.js index f6826bce..ed3c5143 100644 --- a/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/SystemPerformance.js +++ b/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/SystemPerformance.js @@ -114,30 +114,28 @@ const SystemPerformance = () => { } const getFiatVolume = () => - new BigNumber(R.sum(getFiats(transactionsToShow))) - .decimalPlaces(2) - .toNumber() + new BigNumber(R.sum(getFiats(transactionsToShow))).toFormat(2) const getProfit = transactions => { const cashInFees = R.sum(mapToFee(transactions)) const commissionFees = R.reduce(reducer, 0, transactions) return new BigNumber(commissionFees + cashInFees) - .decimalPlaces(2) - .toNumber() } const getPercentChange = () => { - const thisTimePeriodProfit = getProfit(transactionsToShow) - const previousTimePeriodProfit = getProfit(transactionsLastTimePeriod) + const thisTimePeriodProfit = getProfit(transactionsToShow).toNumber() + const previousTimePeriodProfit = getProfit( + transactionsLastTimePeriod + ).toNumber() if (thisTimePeriodProfit === previousTimePeriodProfit) return 0 if (previousTimePeriodProfit === 0) return 100 - return Math.round( - (100 * (thisTimePeriodProfit - previousTimePeriodProfit)) / - Math.abs(previousTimePeriodProfit) - ) + return new BigNumber( + ((thisTimePeriodProfit - previousTimePeriodProfit) * 100) / + previousTimePeriodProfit + ).toFormat(2) } const getDirectionPercent = () => { @@ -207,7 +205,7 @@ const SystemPerformance = () => {
- {`${getProfit(transactionsToShow)} ${ + {`${getProfit(transactionsToShow).toFormat(2)} ${ data?.config.locale_fiatCurrency }`}
diff --git a/new-lamassu-admin/src/pages/Funding.js b/new-lamassu-admin/src/pages/Funding.js index 0d499eff..f4a8a3ac 100644 --- a/new-lamassu-admin/src/pages/Funding.js +++ b/new-lamassu-admin/src/pages/Funding.js @@ -5,6 +5,7 @@ import classnames from 'classnames' import gql from 'graphql-tag' import moment from 'moment' import QRCode from 'qrcode.react' +import * as R from 'ramda' import React, { useState } from 'react' import TableLabel from 'src/components/TableLabel' @@ -16,7 +17,6 @@ import { Info1, Info2, Info3, - Mono, Label1, Label3 } from 'src/components/typography' @@ -108,9 +108,10 @@ const Funding = () => { } const { data: fundingResponse } = useQuery(GET_FUNDING) + const funding = R.path(['funding'])(fundingResponse) ?? [] - if (fundingResponse?.funding?.length && !selected) { - setSelected(fundingResponse?.funding[0]) + if (funding.length && !selected) { + setSelected(funding[0]) } const itemRender = (it, active) => { @@ -129,7 +130,7 @@ const Funding = () => { {!it.errorMsg && ( <>
- {it.fiatConfirmedBalance} {it.fiatCode} + {formatNumber(it.fiatConfirmedBalance)} {it.fiatCode}
{it.confirmedBalance} {it.cryptoCode} @@ -140,7 +141,7 @@ const Funding = () => { ) } - const pendingTotal = getPendingTotal(fundingResponse?.funding || []) + const pendingTotal = getPendingTotal(funding) const signIfPositive = num => (num >= 0 ? '+' : '') return ( @@ -151,19 +152,19 @@ const Funding = () => {
it.display} itemRender={itemRender}> - {fundingResponse?.funding && fundingResponse?.funding?.length && ( + {funding.length && (
Total Crypto Balance - {getConfirmedTotal(fundingResponse.funding)} - {fundingResponse.funding[0].fiatCode} + {getConfirmedTotal(funding)} + {funding[0].fiatCode} ({signIfPositive(pendingTotal)} {pendingTotal} pending) @@ -208,7 +209,7 @@ const Funding = () => {

Address

- +
{formatAddress( @@ -217,7 +218,7 @@ const Funding = () => { )} - +
diff --git a/new-lamassu-admin/src/pages/Funding.styles.js b/new-lamassu-admin/src/pages/Funding.styles.js index 4f9591fe..e54457e0 100644 --- a/new-lamassu-admin/src/pages/Funding.styles.js +++ b/new-lamassu-admin/src/pages/Funding.styles.js @@ -8,7 +8,7 @@ import { comet } from 'src/styling/variables' -const { label1 } = typographyStyles +const { label1, mono } = typographyStyles export default { wrapper: { @@ -91,5 +91,10 @@ export default { paddingTop: 6, paddingLeft: 15, marginRight: -11 + }, + mono: { + extend: mono, + width: 375, + margin: `${spacer * 1.5}px ${spacer * 3}px` } }