diff --git a/src/components/admin-lte/wallet/wallet-info.js b/src/components/admin-lte/wallet/wallet-info.js index 8d2f2e2..da8928c 100644 --- a/src/components/admin-lte/wallet/wallet-info.js +++ b/src/components/admin-lte/wallet/wallet-info.js @@ -18,12 +18,16 @@ class WalletInfo extends React.Component { slpAddress: '', legacyAddress: '', hdPath: '', - blurredMnemonic: true + blurredMnemonic: true, + blurredPrivateKey: true } } render () { - const eyeIcon = _this.state.blurredMnemonic ? 'eye-slash' : 'eye' + const eyeIcon = { + mnemonic: _this.state.blurredMnemonic ? 'eye-slash' : 'eye', + privateKey: _this.state.blurredPrivateKey ? 'eye-slash' : 'eye' + } return ( @@ -54,7 +58,7 @@ class WalletInfo extends React.Component { className='icon btn-animation' size='lg' onClick={() => _this.blurMnemonic()} - icon={eyeIcon} + icon={eyeIcon.mnemonic} /> - Private Key: {_this.state.privateKey} + Private Key: {_this.state.privateKey} _this.blurPrivateKey()} + icon={eyeIcon.privateKey} + /> + _this.copyToClipBoard('privateKey')} icon='copy' /> @@ -170,6 +180,12 @@ class WalletInfo extends React.Component { }) } + blurPrivateKey () { + _this.setState({ + blurredPrivateKey: (!_this.state.blurredPrivateKey) + }) + } + // copy info to clipboard copyToClipBoard (key) { const val = _this.state[key]