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 (
{pubkey}
copyOnClick(pubkey)}
className={`${styles.copy} hint--left`}
data-hint="Copy pubkey"
>
{address}
copyOnClick(address)}
className={`${styles.copy} hint--left`}
data-hint="Copy address"
>