diff options
Diffstat (limited to 'ui/app/components/copyButton.js')
-rw-r--r-- | ui/app/components/copyButton.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/app/components/copyButton.js b/ui/app/components/copyButton.js index ea1c43d54..a60d33523 100644 --- a/ui/app/components/copyButton.js +++ b/ui/app/components/copyButton.js @@ -1,13 +1,19 @@ const Component = require('react').Component +const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const copyToClipboard = require('copy-to-clipboard') -const connect = require('../metamask-connect') +const connect = require('react-redux').connect const Tooltip = require('./tooltip') +CopyButton.contextTypes = { + t: PropTypes.func, +} + module.exports = connect()(CopyButton) + inherits(CopyButton, Component) function CopyButton () { Component.call(this) @@ -23,7 +29,7 @@ CopyButton.prototype.render = function () { const value = props.value const copied = state.copied - const message = copied ? this.props.t('copiedButton') : props.title || this.props.t('copyButton') + const message = copied ? this.context.t('copiedButton') : props.title || this.context.t('copyButton') return h('.copy-button', { style: { |