import React from 'react' import PropTypes from 'prop-types' import copy from 'copy-to-clipboard' import QRCode from 'qrcode.react' import copyIcon from 'icons/copy.svg' import Isvg from 'react-inlinesvg' import x from 'icons/x.svg' import { showNotification } from 'notifications' import styles from './ReceiveModal.scss' class ReceiveModal extends React.Component { constructor(props) { super(props) this.state = { qrCodeType: 1 } } render() { const copyOnClick = data => { copy(data) showNotification('Noice', 'Successfully copied to clipboard') } const changeQrCode = () => { const { qrCodeType } = this.state if (qrCodeType === 1) { this.setState({ qrCodeType: 2 }) } else { this.setState({ qrCodeType: 1 }) } } const { isOpen, pubkey, address, alias, closeReceiveModal, network } = this.props const { qrCodeType } = this.state if (!isOpen) { return null } return (

{alias && alias.length ? alias : pubkey.substring(0, 10)}

Node Pubkey
Bitcoin Address

Node Public Key

{pubkey} copyOnClick(pubkey)} className={`${styles.copy} hint--left`} data-hint="Copy pubkey" >

Bitcoin {network.name} Address

{address} copyOnClick(address)} className={`${styles.copy} hint--left`} data-hint="Copy address" >

) } } ReceiveModal.propTypes = { network: PropTypes.shape({ name: PropTypes.string }).isRequired, isOpen: PropTypes.bool.isRequired, pubkey: PropTypes.string, address: PropTypes.string, alias: PropTypes.string, closeReceiveModal: PropTypes.func.isRequired } export default ReceiveModal