Skip to content

Commit

Permalink
fix: token page
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Oct 21, 2022
1 parent 8a301af commit 39798d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions types/token.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ interface Token {
decimals: string
holderCount?: number
holdersCount?: number
transfersCount?: number
name: string
symbol: string
totalSupply: string
Expand Down
2 changes: 1 addition & 1 deletion utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const convertBalanceToView = (value: number | string, decimals = 18) => {
const big = BigNumber.from(value)
const valueInWei = formatUnits(big, decimals).valueOf()
if (parseFloat(valueInWei) < 10 ** -6) return 0
return numeral(valueInWei).format('0.0000')
return numeral(valueInWei).format('0,0.0000')
}
/**
* return format text of date
Expand Down
9 changes: 7 additions & 2 deletions views/tokens/TokenOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ const TokenOverview = ({ token, tokenData }: Props) => {
</span>
</div>
<div className="">
<span className="text text-base contrast-color-50">Decimals:</span>
<span className="text text-base contrast-color-50">Transfers Count:</span>
<br />
<span className="text text-base">{tokenData.decimals}</span>
<span className="text text-base">{numeral(tokenData.transfersCount || 0).format('0,0')}</span>
</div>
<div className="">
<span className="text text-base contrast-color-50">Token Type:</span>
<br />
<span className="text text-base">{tokenData.type}</span>
</div>
<div className="">
<span className="text text-base contrast-color-50">Decimals:</span>
<br />
<span className="text text-base">{tokenData.decimals}</span>
</div>
</Row>
</BackgroundCard>
)
Expand Down

0 comments on commit 39798d6

Please sign in to comment.