aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/copyButton.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/copyButton.js')
-rw-r--r--ui/app/components/copyButton.js26
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)
+ },
+ })
+}