Skip to content

Commit

Permalink
fix: fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
salimtb committed Jul 2, 2024
1 parent 77d5006 commit 5a480a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Asset({
secondary={formattedFiat}
title={title}
tooltipText={tooltipText}
hidePercentage
showPercentage={false}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export default function AssetList({
display={Display.Block}
flexWrap={FlexWrap.NoWrap}
alignItems={AlignItems.center}
style={{ cursor: 'pointer' }}
>
<Box marginInlineStart={2}>
{token.type === AssetType.native ? (
Expand Down Expand Up @@ -162,7 +161,7 @@ export default function AssetList({
tokenImage={token.image}
isNativeCurrency
isOriginalTokenSymbol={isOriginalNativeSymbol}
hidePercentage
showPercentage={false}
/>
) : (
<AssetComponent
Expand Down
14 changes: 7 additions & 7 deletions ui/components/multichain/token-list-item/token-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const TokenListItem = ({
isNativeCurrency = false,
isStakeable = false,
address = null,
hidePercentage = false,
showPercentage = true,
}) => {
const t = useI18nContext();
const isEvm = useSelector(getMultichainIsEvm);
Expand All @@ -87,7 +87,7 @@ export const TokenListItem = ({

// Scam warning
const showScamWarning =
isNativeCurrency && !isOriginalTokenSymbol && !hidePercentage;
isNativeCurrency && !isOriginalTokenSymbol && showPercentage;

const dispatch = useDispatch();
const [showScamWarningModal, setShowScamWarningModal] = useState(false);
Expand Down Expand Up @@ -160,7 +160,7 @@ export const TokenListItem = ({
// Used for badge icon
const currentNetwork = useSelector(getMultichainCurrentNetwork);
const testNetworkBackgroundColor = useSelector(getTestNetworkBackgroundColor);
const tokenMainTitleToDisplay = hidePercentage ? tokenSymbol : tokenTitle;
const tokenMainTitleToDisplay = showPercentage ? tokenTitle : tokenSymbol;

return (
<Box
Expand Down Expand Up @@ -283,11 +283,11 @@ export const TokenListItem = ({
</Text>
)}

{isEvm && hidePercentage ? (
{isEvm && !showPercentage ? (
<Text
variant={TextVariant.bodyMd}
color={TextColor.textAlternative}
data-testid="multichain-token-list-item-token-name" //
data-testid="multichain-token-list-item-token-name"
ellipsis
>
{tokenTitle}
Expand Down Expand Up @@ -454,7 +454,7 @@ TokenListItem.propTypes = {
address: PropTypes.string,

/**
* hidePercentage represents if the increase decrease percentage will be hidden
* showPercentage represents if the increase decrease percentage will be hidden
*/
hidePercentage: PropTypes.bool,
showPercentage: PropTypes.bool,
};
1 change: 0 additions & 1 deletion ui/hooks/useTokenFiatAmount.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export function useTokenFiatAmount(
const tokenExchangeRate =
overrides.exchangeRate ??
(contractExchangeTokenKey && mergedRates[contractExchangeTokenKey]);

const formattedFiat = useMemo(
() =>
getTokenFiatAmount(
Expand Down

0 comments on commit 5a480a3

Please sign in to comment.