react-feather#Clipboard JavaScript Examples

The following examples show how to use react-feather#Clipboard. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddressViewer.js    From ucurtmetre with GNU General Public License v3.0 6 votes vote down vote up
function AddressViewer({ data, title = 'BiLira Cüzdanı' }) {
  const { onCopy, hasCopied } = useClipboard(data);

  return (
    <div className="address-container">
      <a
        mr={4}
        target="_blank"
        rel="noopener noreferrer"
        href={`https://etherscan.io/address/${data}`}
      >
        <div className="qr-container">
          <QRCode
            bgColor="#FFFFFF"
            fgColor="#000000"
            level="Q"
            style={{ width: 200, padding: '1rem' }}
            value={data}
          />
        </div>
      </a>
      <div className="address">
        <h3>{title}</h3>
        <p>
          {data}
          <button onClick={onCopy} type="button" className="button">
            {hasCopied ? <CheckCircle /> : <Clipboard />}
          </button>
        </p>
      </div>
    </div>
  );
}