Skip to content

Commit

Permalink
Merge branch 'develop' into jl/added-generic-polling-hook-replace-use…
Browse files Browse the repository at this point in the history
…Safe
  • Loading branch information
adonesky1 authored Mar 6, 2024
2 parents 64c3fd5 + ca90dde commit 974acba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
21 changes: 10 additions & 11 deletions ui/components/app/asset-list/asset-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ const AssetList = ({ onClickAsset }) => {
numberOfDecimals: secondaryNumberOfDecimals,
} = useUserPreferencedCurrency(SECONDARY, { ethNumberOfDecimals: 4 });

const [, primaryCurrencyProperties] = useCurrencyDisplay(
selectedAccountBalance,
{
const [primaryCurrencyDisplay, primaryCurrencyProperties] =
useCurrencyDisplay(selectedAccountBalance, {
numberOfDecimals: primaryNumberOfDecimals,
currency: primaryCurrency,
},
);
});

const [secondaryCurrencyDisplay, secondaryCurrencyProperties] =
useCurrencyDisplay(selectedAccountBalance, {
Expand Down Expand Up @@ -226,14 +224,15 @@ const AssetList = ({ onClickAsset }) => {
<TokenListItem
onClick={() => onClickAsset(nativeCurrency)}
title={nativeCurrency}
// The primary and secondary currencies are subject to change based on the user's settings
// TODO: rename this primary/secondary concept here to be more intuitive, regardless of setting
primary={
showPrimaryCurrency(
showSecondaryCurrency(
isOriginalNativeSymbol,
useNativeCurrencyAsPrimaryCurrency,
)
? primaryCurrencyProperties.value ??
secondaryCurrencyProperties.value
: null
? secondaryCurrencyDisplay
: undefined
}
tokenSymbol={
useNativeCurrencyAsPrimaryCurrency
Expand All @@ -242,11 +241,11 @@ const AssetList = ({ onClickAsset }) => {
}
secondary={
showFiat &&
showSecondaryCurrency(
showPrimaryCurrency(
isOriginalNativeSymbol,
useNativeCurrencyAsPrimaryCurrency,
)
? secondaryCurrencyDisplay
? primaryCurrencyDisplay
: undefined
}
tokenImage={balanceIsLoading ? null : primaryTokenImage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ exports[`Token Cell should match snapshot 1`] = `
5.000
TEST
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ exports[`TokenListItem should render correctly 1`] = `
data-testid="multichain-token-list-item-value"
>
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export const TokenListItem = ({
variant={TextVariant.bodyMd}
textAlign={TextAlign.End}
>
{primary} {tokenSymbol}{' '}
{primary} {isNativeCurrency ? '' : tokenSymbol}
</Text>
</Box>
</Box>
Expand Down

0 comments on commit 974acba

Please sign in to comment.