/* @flow */ 'use strict'; import React from 'react'; import ColorHash from 'color-hash'; import ScaleText from 'react-scale-text'; const PendingTransactions = (props: any): any => { const account = props.accounts.find(a => a.checksum === props.sendForm.checksum && a.index === props.sendForm.accountIndex && a.coin === props.sendForm.coin); const pending = props.pending.filter(p => p.coin === account.coin && p.address === account.address); if (pending.length < 1) return null; const tokens = props.tokens.filter(t => t.ethAddress === account.address); const bgColor = new ColorHash({lightness: 0.7}); const textColor = new ColorHash(); const pendings = pending.map((tx, i) => { let iconColor, symbol, name; if (tx.token !== tx.coin) { const token = tokens.find(t => t.symbol === tx.token); iconColor = { color: textColor.hex(token.name), background: bgColor.hex(token.name), borderColor: bgColor.hex(token.name) } symbol = token.symbol.toUpperCase(); name = token.name; } else { iconColor = { color: textColor.hex(tx.coin), background: bgColor.hex(tx.coin), borderColor: bgColor.hex(tx.coin) } symbol = props.selectedCoin.symbol; name = props.selectedCoin.name; } return (

{ symbol }

{ name }
{ tx.amount } { symbol }
) }); return (

Pending transactions

{ pendings }
) } export default PendingTransactions;