Skip to content

Commit

Permalink
Format gas token balance
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboydiamonds committed Jul 2, 2024
1 parent 79ac792 commit 908dac6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react'
import Image from 'next/image'
import { Token } from '@/utils/types'
import { getParsedBalance } from '@/utils/getParsedBalance'
import { HoverTooltip } from '../../HoverTooltip'
import { HoverTooltip } from '@/components/HoverTooltip'
import { formatAmount } from '@/utils/formatAmount'
import GasIcon from '@/components/icons/GasIcon'

export const GasTokenAsset = ({
Expand All @@ -13,8 +14,7 @@ export const GasTokenAsset = ({
balance: bigint
}) => {
const { icon, symbol, decimals } = token
const parsedBalance = getParsedBalance(balance, decimals as number, 3)
const parsedBalanceLong = getParsedBalance(balance, decimals as number, 8)
const parsedBalance = getParsedBalance(balance, decimals as number)

return (
<div
Expand All @@ -34,12 +34,12 @@ export const GasTokenAsset = ({
<HoverTooltip
hoverContent={
<div className="whitespace-nowrap">
{parsedBalanceLong} {symbol}
{parsedBalance} {symbol}
</div>
}
>
<div>
{parsedBalance} {symbol}
{formatAmount(parsedBalance)} {symbol}
</div>
</HoverTooltip>
<HoverTooltip
Expand Down

0 comments on commit 908dac6

Please sign in to comment.