diff --git a/packages/extension-polkagate/src/components/AccountIcons.tsx b/packages/extension-polkagate/src/components/AccountIcons.tsx index 18de05bf9..d4c92deb6 100644 --- a/packages/extension-polkagate/src/components/AccountIcons.tsx +++ b/packages/extension-polkagate/src/components/AccountIcons.tsx @@ -46,14 +46,14 @@ function AccountIcons ({ address, identiconTheme, isSubId, judgements, prefix }: }, [address]); return ( - + diff --git a/packages/extension-polkagate/src/components/FormatPrice.tsx b/packages/extension-polkagate/src/components/FormatPrice.tsx index 869d6d66d..befc8c1a9 100644 --- a/packages/extension-polkagate/src/components/FormatPrice.tsx +++ b/packages/extension-polkagate/src/components/FormatPrice.tsx @@ -58,6 +58,16 @@ export function nFormatter (num: number, decimalPoint: number) { const DECIMAL_POINTS_FOR_CRYPTO_AS_CURRENCY = 4; const SMALL_DECIMALS_FONT_SIZE_REDUCTION = 20; +const DecimalPart = ({ value, withCountUp }: { value: string | number, withCountUp: boolean | undefined }) => ( + withCountUp + ? + : <>{`.${getDecimal(value)}`} +); + function FormatPrice ({ amount, commify, decimalPoint = 2, decimals, fontSize, fontWeight, height, lineHeight = 1, mt = '0px', num, price, sign, skeletonHeight = 15, textAlign = 'left', textColor, width = '90px', withCountUp, withSmallDecimal }: Props): React.ReactElement { const currency = useCurrency(); const theme = useTheme(); @@ -135,16 +145,10 @@ function FormatPrice ({ amount, commify, decimalPoint = 2, decimals, fontSize, f lineHeight={lineHeight} sx={{ color: theme.palette.secondary.contrastText }} > - {withCountUp - ? - : <> - {`.${getDecimal(total)}`} - - } + } diff --git a/packages/extension-polkagate/src/components/MenuItem.tsx b/packages/extension-polkagate/src/components/MenuItem.tsx index 93b638eeb..59570c7bc 100644 --- a/packages/extension-polkagate/src/components/MenuItem.tsx +++ b/packages/extension-polkagate/src/components/MenuItem.tsx @@ -12,7 +12,7 @@ import { noop } from '../util/utils'; interface Props { disabled?: boolean; icon?: string; - iconComponent?: JSX.Element; + iconComponent?: React.JSX.Element; text: string; children?: React.ReactElement; onClick?: MouseEventHandler; @@ -35,8 +35,8 @@ export default function MenuItem ({ children, disabled = false, fontSize, icon, return ( <> - - + + {iconComponent ?? {endpoint &&