// Copyright 2015-2018 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: BSD-3-Clause import React from 'react'; import PropTypes from 'prop-types'; import { Card } from '../Card'; import { Placeholder } from '../Placeholder'; export const TokenCard = ({ balance, children, decimals, showBalance, token, ...otherProps }) => (
{token.logo ? ( {token.symbol} ) : ( )}
{token.name ? token.name : }
{balance ? ( {balance.toFixed(decimals)} ) : showBalance ? ( ) : null} {token.symbol}
{children}
); TokenCard.defaultProps = { decimals: 2, showBalance: true }; TokenCard.propTypes = { decimals: PropTypes.number.isRequired, token: PropTypes.shape({ logo: PropTypes.string, name: PropTypes.string, symbol: PropTypes.string }).isRequired }; export default TokenCard;