/* @flow */ 'use strict'; import React, { Component } from 'react'; import BigNumber from 'bignumber.js'; import { Async } from 'react-select'; import Tooltip from 'rc-tooltip'; import { resolveAfter } from '~/js/utils/promiseUtils'; import AbstractAccount from '../AbstractAccount'; import { Notification } from '~/js/components/common/Notification'; import SummaryDetails from './SummaryDetails.js'; import SummaryTokens from './SummaryTokens.js'; import type { Props } from './index'; import type { AccountState } from '../AbstractAccount'; import type { TrezorDevice } from '~/flowtype'; import type { NetworkToken } from '~/js/reducers/LocalStorageReducer'; import type { Account } from '~/js/reducers/AccountsReducer'; import type { Discovery } from '~/js/reducers/DiscoveryReducer'; import { findAccountTokens } from '~/js/reducers/TokensReducer'; export default class Summary extends AbstractAccount { render() { return super.render() || _render(this.props, this.state); } } const _render = (props: Props, state: AccountState): React$Element => { const { device, account, deviceStatusNotification } = state; const abstractAccount = props.abstractAccount; if (!device || !account || !abstractAccount) return
; const tokens = findAccountTokens(props.tokens, account); const explorerLink: string = `${abstractAccount.coin.explorer.address}${account.address}`; const tokensTooltip = (
Insert token name, symbol or address to be able to send it.
); return (
{ deviceStatusNotification }

Account #{ parseInt(abstractAccount.index) + 1 } See full transaction history

Tokens } overlay={ tokensTooltip } placement="top">

{/* 0x58cda554935e4a1f2acbe15f8757400af275e084 Lahod */} {/* 0x58cda554935e4a1f2acbe15f8757400af275e084 T01 */}
props.addToken(token, account) } loadOptions={ input => props.loadTokens(input, account.network) } filterOptions= { (options: Array, search: string, values: Array) => { return options.map(o => { const added = tokens.find(t => t.symbol === o.symbol); if (added) { return { ...o, name: `${o.name} (Already added)`, disabled: true }; } else { return o; } }); // return options.filter(o => { // return !tokens.find(t => t.symbol === o.symbol); // }); } } valueKey="symbol" labelKey="name" placeholder="Search for token" searchPromptText="Type token name or address" noResultsText="Token not found" />
); }