Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Wallet/TokenList.js
import React from 'react'; | import React from 'react'; | ||||
import TokenListItem from './TokenListItem'; | import TokenListItem from './TokenListItem'; | ||||
import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||
import { currency } from '@components/Common/Ticker.js'; | import { currency } from '@components/Common/Ticker.js'; | ||||
import { formatBalance } from '@utils/cashMethods'; | |||||
const TokenList = ({ tokens }) => { | const TokenList = ({ tokens }) => { | ||||
return ( | return ( | ||||
<div> | <div> | ||||
<h2 style={{ color: '#444' }}>{currency.tokenTicker} Tokens</h2> | <h2 style={{ color: '#444' }}>{currency.tokenTicker} Tokens</h2> | ||||
{tokens.map(token => ( | {tokens.map(token => ( | ||||
<Link key={token.tokenId} to={`/send-token/${token.tokenId}`}> | <Link key={token.tokenId} to={`/send-token/${token.tokenId}`}> | ||||
<TokenListItem | <TokenListItem | ||||
ticker={token.info.tokenTicker} | ticker={token.info.tokenTicker} | ||||
tokenId={token.tokenId} | tokenId={token.tokenId} | ||||
balance={token.balance.toString()} | balance={formatBalance(token.balance)} | ||||
/> | /> | ||||
</Link> | </Link> | ||||
))} | ))} | ||||
</div> | </div> | ||||
); | ); | ||||
}; | }; | ||||
export default TokenList; | export default TokenList; |