diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-06-30 05:11:12 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-06-30 05:11:12 +0800 |
commit | 441a7eec2899c6553004ced2245d17ef9cc33a51 (patch) | |
tree | 895c576fc6068bb4e791f3dfe74b1afb446f647e | |
parent | 757a3ce6beed9519005c6d6b2aa439d849173b29 (diff) | |
download | tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.tar tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.tar.gz tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.tar.bz2 tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.tar.lz tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.tar.xz tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.tar.zst tangerine-wallet-browser-441a7eec2899c6553004ced2245d17ef9cc33a51.zip |
Add CopyButton component
-rw-r--r-- | ui/app/components/copyButton.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/app/components/copyButton.js b/ui/app/components/copyButton.js new file mode 100644 index 000000000..74fd673c2 --- /dev/null +++ b/ui/app/components/copyButton.js @@ -0,0 +1,26 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits +const copyToClipboard = require('copy-to-clipboard') + +module.exports = CopyButton + +inherits(CopyButton, Component) +function CopyButton () { + Component.call(this) +} + +CopyButton.prototype.render = function () { + const props = this.props + const value = props.value + + return h('img.cursor-pointer.color-orange', { + src: 'images/copy.svg', + title: 'Copy Address', + onClick: (event) => { + event.preventDefault() + event.stopPropagation() + copyToClipboard(value) + }, + }) +} |