Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Wallet/TokenList.js
import React from 'react'; | import React from 'react'; | ||||
import styled from 'styled-components'; | |||||
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 { formatBalance } from '@utils/cashMethods'; | import { formatBalance } from '@utils/cashMethods'; | ||||
export const TokenTitle = styled.h2` | |||||
color: ${props => props.theme.wallet.text.secondary}; | |||||
`; | |||||
const TokenList = ({ tokens }) => { | const TokenList = ({ tokens }) => { | ||||
return ( | return ( | ||||
<div> | <div> | ||||
<TokenTitle>{currency.tokenTicker} Tokens</TokenTitle> | |||||
{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={formatBalance(token.balance)} | balance={formatBalance(token.balance)} | ||||
/> | /> | ||||
</Link> | </Link> | ||||
))} | ))} | ||||
</div> | </div> | ||||
); | ); | ||||
}; | }; | ||||
export default TokenList; | export default TokenList; |