Skip to content

Commit

Permalink
fix: display nfttoken amount in address detail
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendn committed Jun 13, 2023
1 parent 80af6b2 commit d76cb5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions views/accounts/tabs/AddressTokenTab/AddressTokenRow.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import clsx from 'clsx'
import Row from 'components/Grid/Row'
import { LinkText } from 'components/Typography/LinkText'
import { convertBalanceToView, ellipseBetweenText, LinkMaker } from 'utils/helper'
import { convertBalanceToView, ellipseBetweenText, isERC721, LinkMaker } from 'utils/helper'
import styles from './style.module.scss'

interface Props {
data: AddressToken
}

const AddressTokenRow = ({ data }: Props) => {
const isNFT = isERC721(data.type)
return (
<Row
classes={clsx(
Expand All @@ -21,10 +22,10 @@ const AddressTokenRow = ({ data }: Props) => {
<div className={clsx('col-1 margin-right-xs', styles.colType)}>
<span>{data.type}</span>
</div>
<div className={clsx('col-3 margin-right-xs', styles.colAmount)}>
<span>{convertBalanceToView(data.balance)}</span>
<div className={clsx('col-2 margin-right-xs', styles.colAmount)}>
<span>{isNFT ? data.balance : convertBalanceToView(data.balance)}</span>
</div>
<div className={clsx('col-1 margin-right-xs', styles.colSymbol)}>
<div className={clsx('col-2 margin-right-xs', styles.colSymbol)}>
<span>{data.symbol}</span>
</div>
<div className={clsx('col-1', styles.colPrice)}>
Expand Down
4 changes: 2 additions & 2 deletions views/accounts/tabs/AddressTokenTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ const AddressTokenTab = ({ address, addressData }: Props) => {
>
<div className={clsx('col-2 margin-right-xs', styles.colSymbol)}>Assets</div>
<div className={clsx('col-1 margin-right-xs', styles.colType)}>Type</div>
<div className={clsx('col-3 margin-right-xs', styles.colAmount)}>Amount</div>
<div className={clsx('col-1 margin-right-xs', styles.colSymbol)}>Symbol</div>
<div className={clsx('col-2 margin-right-xs', styles.colAmount)}>Amount</div>
<div className={clsx('col-2 margin-right-xs', styles.colSymbol)}>Symbol</div>
<div className={clsx('col-1', styles.colPrice)}>Price</div>
<div className={clsx('col-1', styles.colValue)}>Value</div>
<div className={clsx('col-3', styles.colAddress)}>Contract Address</div>
Expand Down

0 comments on commit d76cb5f

Please sign in to comment.