Skip to content

Commit

Permalink
fix: update display amount with NFT in tokens list
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Jan 9, 2023
1 parent 47f27cb commit 714ea4c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions views/tokens/TokenRow.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { formatNumber } from '@astraprotocol/astra-ui'
import clsx from 'clsx'
import Typography from 'components/Typography'
import { convertBalanceToView, ellipseRightText, getEnvNumber, LinkMaker } from 'utils/helper'
import { convertBalanceToView, ellipseRightText, getEnvNumber, isERC721, LinkMaker } from 'utils/helper'
import styles from './style.module.scss'

type Props = {
Expand All @@ -11,6 +11,7 @@ type Props = {
}

export default function TokenRow({ index, token }: Props) {
const isNFT = isERC721(token.type)
return (
<div
className={clsx(
Expand Down Expand Up @@ -43,10 +44,12 @@ export default function TokenRow({ index, token }: Props) {

<div className={clsx(styles.borderLeft, styles.colTotalSupply, 'col padding-left-lg col-3')}>
<span className={clsx('money money-sm money-bold padding-right-xs')}>
{formatNumber(
convertBalanceToView(token.totalSupply, parseInt(token.decimals || '1')),
getEnvNumber('NEXT_PUBLIC_MAXIMUM_FRACTION_DIGITS')
)}
{isNFT
? 1
: formatNumber(
convertBalanceToView(token.totalSupply, parseInt(token.decimals || '1')),
getEnvNumber('NEXT_PUBLIC_MAXIMUM_FRACTION_DIGITS')
)}
</span>
<span className={clsx(styles.currency, 'money money-sm money-bold')}>{token.symbol}</span>
</div>
Expand Down

0 comments on commit 714ea4c

Please sign in to comment.