Skip to content

Commit 268d5c1

Browse files
authored
feat(wallet, wallet dashboard): avoid rounding balance changes in tx details (#5435)
1 parent d3ccade commit 268d5c1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

apps/core/src/components/cards/BalanceChanges.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { CoinItem } from '../coin';
1111
import { RecognizedBadge } from '@iota/apps-ui-icons';
1212
import { getRecognizedUnRecognizedTokenChanges } from '../../utils';
1313
import { BalanceChange } from '../../interfaces';
14+
import { CoinFormat } from '../../hooks';
1415

1516
interface BalanceChangesProps {
1617
renderExplorerLink: RenderExplorerLink;
@@ -62,6 +63,7 @@ function BalanceChangeEntry({ change }: { change: BalanceChange }) {
6263
<RecognizedBadge className="h-4 w-4 text-primary-40" />
6364
)
6465
}
66+
format={CoinFormat.FULL}
6567
/>
6668
);
6769
}

apps/core/src/components/coin/CoinItem.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import { CoinIcon, ImageIconSize } from '../';
1414
import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils';
1515
import { type ReactNode } from 'react';
16-
import { useFormatCoin } from '../../hooks';
16+
import { CoinFormat, useFormatCoin } from '../../hooks';
1717

1818
interface CoinItemProps {
1919
coinType: string;
@@ -22,6 +22,7 @@ interface CoinItemProps {
2222
icon?: ReactNode;
2323
clickableAction?: ReactNode;
2424
usd?: number;
25+
format?: CoinFormat;
2526
}
2627

2728
export function CoinItem({
@@ -31,8 +32,9 @@ export function CoinItem({
3132
icon,
3233
clickableAction,
3334
usd,
35+
format,
3436
}: CoinItemProps): React.JSX.Element {
35-
const [formatted, symbol, { data: coinMeta }] = useFormatCoin({ balance, coinType });
37+
const [formatted, symbol, { data: coinMeta }] = useFormatCoin({ balance, coinType, format });
3638
const isIota = coinType === IOTA_TYPE_ARG;
3739

3840
return (

0 commit comments

Comments
 (0)