import React, {Component} from 'react'; import * as Icon from 'react-cryptocoins'; type CardProps = { title: string, content: string, logo?: JSX.Element, } export type CoinBalanceProps = { name: string, amount: number, short: string, percentage?: number, quote_equivalent: number, quote_symbol: string, icon: JSX.Element, } class CoinBalance extends Component { constructor(props) { super(props); } render() { return (
{this.props.icon}
{this.props.name}
{Math.trunc(this.props.percentage)}%
{this.props.amount.toFixed(5)} {this.props.short}
{this.props.quote_symbol} {this.props.quote_equivalent}
) } } export class SidebarCard extends Component { constructor(props: CardProps) { super(props) } render() { return (
{this.props.logo} {this.props.title}
{this.props.content}
) } } export type WalletCardProps = { balances: Array, total_balance: number, quote_symbol: string } export class WalletCard extends Component { constructor(props) { super(props); } renderCoinBalances() { return ( this.props.balances.map((balance) => { return ( ) }) ) } render() { return (

Your Wallets

{this.renderCoinBalances()}
Total Balance ≈ {this.props.quote_symbol}{this.props.total_balance.toFixed(2)}
) } }