Skip to content

Commit 75ce3d4

Browse files
committed
fixes after rebase
1 parent 120a443 commit 75ce3d4

File tree

1 file changed

+6
-7
lines changed
  • src/components/v5/common/CompletedAction/partials/PaymentBuilder/partials/PaymentBuilderTable/partials/EditContent/partials/TokenField

1 file changed

+6
-7
lines changed

src/components/v5/common/CompletedAction/partials/PaymentBuilder/partials/PaymentBuilderTable/partials/EditContent/partials/TokenField/TokenField.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import clsx from 'clsx';
22
import React, { type FC } from 'react';
33

4-
import { DEFAULT_TOKEN_DECIMALS } from '~constants';
54
import { useGetAllTokens } from '~hooks/useGetAllTokens.ts';
6-
import { getFormattedTokenAmount } from '~v5/common/CompletedAction/partials/utils.ts';
5+
import Numeral from '~shared/Numeral/Numeral.tsx';
6+
import { getTokenDecimalsWithFallback } from '~utils/tokens.ts';
77
import { TokenAvatar } from '~v5/shared/TokenAvatar/TokenAvatar.tsx';
88

99
interface TokenFieldProps {
@@ -17,10 +17,6 @@ const TokenField: FC<TokenFieldProps> = ({ amount, tokenAddress, isNew }) => {
1717
const currentToken = allTokens.find(
1818
({ token }) => token.tokenAddress === tokenAddress,
1919
);
20-
const formattedAmount = getFormattedTokenAmount(
21-
amount,
22-
currentToken?.token.decimals || DEFAULT_TOKEN_DECIMALS,
23-
);
2420

2521
return amount ? (
2622
<div className="flex items-center gap-1 text-3">
@@ -30,7 +26,10 @@ const TokenField: FC<TokenFieldProps> = ({ amount, tokenAddress, isNew }) => {
3026
'text-gray-900': !isNew,
3127
})}
3228
>
33-
{formattedAmount}
29+
<Numeral
30+
value={amount}
31+
decimals={getTokenDecimalsWithFallback(currentToken?.token.decimals)}
32+
/>
3433
</span>
3534
<TokenAvatar
3635
tokenAddress={currentToken?.token.tokenAddress || ''}

0 commit comments

Comments
 (0)