/* @flow */ 'use strict'; import React, { Component } from 'react'; import Tooltip from 'rc-tooltip'; import { QRCode } from 'react-qr-svg'; import AbstractAccount from '../AbstractAccount'; import { Notification } from '../../../common/Notification'; import type { AccountState } from '../AbstractAccount'; import type { Props } from './index'; export default class Receive extends AbstractAccount { render() { return super.render() || _render(this.props, this.state); } } const _render = (props: Props, state: AccountState): React$Element => { const { device, account, discovery, deviceStatusNotification } = state; const { addressVerified, addressUnverified, } = props.receive; if (!device || !account || !discovery) return
; 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 && device.available ? '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 (
{ deviceStatusNotification }

Receive Ethereum or tokens

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