/* @flow */ 'use strict'; import React, { Component } from 'react'; import { QRCode } from 'react-qr-svg'; import AbstractAccount from './account/AbstractAccount'; import { Notification } from '../common/Notification'; import Tooltip from 'rc-tooltip'; export default class Receive extends AbstractAccount { render() { return super.render(this.props.receive) || _render(this.props); } } const _render = (props: any): any => { const { network, deviceState, accountIndex, addressVerified, addressUnverified, } = props.receive; const device = props.devices.find(d => d.state === deviceState); const account = props.accounts.find(a => a.deviceState === deviceState && a.index === accountIndex && a.network === network); let qrCode = null; let address = `${account.address.substring(0, 20)}...`; let className = 'address hidden'; let button = ( ); if (addressVerified || addressUnverified) { qrCode = ( ); address = account.address; className = addressUnverified ? 'address unverified' : 'address'; const tooltip = addressUnverified ? (
Unverified address.
{ device.connected ? 'Show on TREZOR' : 'Connect your TREZOR to verify it.' }
) : (
{ device.connected ? 'Show on TREZOR' : 'Connect your TREZOR to verify address.' }
); button = ( } overlay={ tooltip } placement="bottomRight"> ); } return (
{ !device.connected ? ( ) : null }

Receive Ethereum or tokens

{ address }
{ button }
{ qrCode }
); }