Skip to content

Commit

Permalink
truncate formatted balance
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitayutanov committed Dec 20, 2024
1 parent 4be9c1d commit aaa0941
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.

This file was deleted.

12 changes: 5 additions & 7 deletions frontend/src/components/formatted-balance/fortmatted-balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import { formatBalance } from '@polkadot/util';
import { ComponentProps } from 'react';
import { formatUnits } from 'viem';

import { cx } from '@/utils';

import { TruncatedText } from '../layout';
import { Tooltip } from '../tooltip';

import styles from './fortmatted-balance.module.scss';

type Props = {
value: bigint;
decimals: number;
Expand All @@ -22,9 +19,10 @@ function FormattedBalance({ value, decimals, symbol, tooltipPosition, className

return (
<Tooltip value={`${formattedValue} ${symbol}`} position={tooltipPosition}>
<span className={cx(styles.balance, className)}>
{compactBalance === '0' ? `${compactBalance} ${symbol}` : compactBalance}
</span>
<TruncatedText
value={compactBalance === '0' ? `${compactBalance} ${symbol}` : compactBalance}
className={className}
/>
</Tooltip>
);
}
Expand Down

0 comments on commit aaa0941

Please sign in to comment.