From b77975e43f45ed00c6e281eef5a0a49ea4961825 Mon Sep 17 00:00:00 2001 From: alecdwm Date: Mon, 9 Dec 2024 03:25:25 +0000 Subject: [PATCH 1/2] fix: include non-rounded amount in data-amount attribute of --- apps/extension/src/ui/domains/Asset/Tokens.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/extension/src/ui/domains/Asset/Tokens.tsx b/apps/extension/src/ui/domains/Asset/Tokens.tsx index 205f55b512..524bccb4fe 100644 --- a/apps/extension/src/ui/domains/Asset/Tokens.tsx +++ b/apps/extension/src/ui/domains/Asset/Tokens.tsx @@ -67,15 +67,14 @@ export const Tokens: FC = ({ const { refReveal, isRevealable, isRevealed, isHidden, effectiveNoCountUp } = useRevealableBalance(isBalance, noCountUp) - const tooltip = useMemo( + const tooltipAmount = useMemo( () => - noTooltip - ? null - : `${formatDecimals(amount, decimals ?? MAX_DECIMALS_FORMAT, { notation: "standard" })} ${ - symbol ?? "" - }`.trim(), - [amount, decimals, noTooltip, symbol], + `${formatDecimals(amount, decimals ?? MAX_DECIMALS_FORMAT, { notation: "standard" })} ${ + symbol ?? "" + }`.trim(), + [amount, decimals, symbol], ) + const tooltip = useMemo(() => (noTooltip ? null : tooltipAmount), [noTooltip, tooltipAmount]) const render = amount !== null && amount !== undefined @@ -92,7 +91,7 @@ export const Tokens: FC = ({ {render && ( - + Date: Mon, 9 Dec 2024 03:33:50 +0000 Subject: [PATCH 2/2] fix: use `relay?.name` instead of `relay?.chainName` in network info rows --- apps/extension/src/ui/hooks/useNetworkInfo.ts | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/apps/extension/src/ui/hooks/useNetworkInfo.ts b/apps/extension/src/ui/hooks/useNetworkInfo.ts index 44edcb0c29..d7440a3116 100644 --- a/apps/extension/src/ui/hooks/useNetworkInfo.ts +++ b/apps/extension/src/ui/hooks/useNetworkInfo.ts @@ -11,25 +11,23 @@ export type NetworkInfoProps = { } export const getNetworkInfo = (t: TFunction, { chain, evmNetwork, relay }: NetworkInfoProps) => { - if (evmNetwork) - return { - label: evmNetwork.name, - type: evmNetwork.isTestnet ? t("EVM Testnet") : t("EVM Blockchain"), - } + if (evmNetwork) { + const label = evmNetwork.name + return { label, type: evmNetwork.isTestnet ? t("EVM Testnet") : t("EVM Blockchain") } + } if (chain) { - if (chain.isTestnet) return { label: chain.name, type: t("Testnet") } - if (chain.paraId) - return { - label: chain.name, - type: relay?.chainName - ? t("{{name}} Parachain", { name: relay?.chainName }) - : t("Parachain"), + const label = chain.name + const type = (() => { + if (chain.isTestnet) return t("Testnet") + if (chain.paraId) { + if (relay?.name) return t("{{name}} Parachain", { name: relay?.name }) + return t("Parachain") } - return { - label: chain.name, - type: (chain.parathreads || []).length > 0 ? t("Relay Chain") : t("Blockchain"), - } + return (chain.parathreads || []).length > 0 ? t("Relay Chain") : t("Blockchain") + })() + + return { label, type } } return { label: "", type: "" }