diff --git a/src/components/AppSummary/AppSummary.columns.js b/src/components/AppSummary/AppSummary.columns.js index fde23f3f2..bff710d41 100644 --- a/src/components/AppSummary/AppSummary.columns.js +++ b/src/components/AppSummary/AppSummary.columns.js @@ -8,6 +8,7 @@ import { formatUsdValue, formatPercentValue, formatUsdValueChange, + shouldShowPercentCheck, } from './AppSummary.helpers' export const getFeesColumns = ({ @@ -141,17 +142,23 @@ export const getAssetColumns = ({ name: 'summary.by_asset.balance_change', width: 178, renderer: (rowIndex) => { - const { valueChange30dUsd, valueChange30dPerc } = preparedData[rowIndex] + const { balanceUsd, valueChange30dUsd, valueChange30dPerc } = preparedData[rowIndex] + const shouldShowPercentChange = shouldShowPercentCheck(balanceUsd, valueChange30dUsd) return ( <> {formatUsdValueChange(valueChange30dUsd)} -
- - {formatPercentValue(valueChange30dPerc)} - + {shouldShowPercentChange && ( + <> +
+ + {formatPercentValue(valueChange30dPerc)} + + + )} +
) diff --git a/src/components/AppSummary/AppSummary.helpers.js b/src/components/AppSummary/AppSummary.helpers.js index 04bd90657..d024225fc 100644 --- a/src/components/AppSummary/AppSummary.helpers.js +++ b/src/components/AppSummary/AppSummary.helpers.js @@ -25,3 +25,11 @@ export const formatUsdValueChange = (value) => { if (val < 0) return {`-$${formatThousands(Math.abs(val))}`} return {`$${formatThousands(val)}`} } + +export const shouldShowPercentCheck = (balance, balanceChange) => { + const bal = prepareNumericValue(balance) + const balChange = prepareNumericValue(balanceChange) + if (balChange === 0) return true + if (bal === balChange) return false + return true +}