add copy to clipboard on signature

This commit is contained in:
Barry Gitarts 2018-08-02 11:13:26 -04:00
parent 3787fb7600
commit 087a3e3a63
3 changed files with 30 additions and 24 deletions

View File

@ -1,5 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import translate, { translateRaw } from 'translations';
import { ISignedMessage } from 'libs/signing';
@ -69,20 +70,25 @@ export class SignMessage extends Component<Props, State> {
</label>
<div className="SignMessage-help">{translate('MSG_INFO2')}</div>
</div>
<SignButton
message={this.state.message}
signMessageRequested={this.props.signMessageRequested}
/>
<div>
<SignButton
message={this.state.message}
signMessageRequested={this.props.signMessageRequested}
/>
</div>
{signedMessage && (
<div className="input-group-wrapper SignMessage-inputBox">
<label className="input-group">
<div className="input-group-header">{translate('MSG_SIGNATURE')}</div>
<CodeBlock className="SignMessage-inputBox">
{JSON.stringify(signedMessage, null, 2)}
</CodeBlock>
</label>
<CopyToClipboard text={JSON.stringify(signedMessage, null, 2)}>
<label className="input-group">
<div className="input-group-header">
{translate('MSG_SIGNATURE')} (Click to copy to clipboard)
</div>
<CodeBlock className="SignMessage-inputBox">
{JSON.stringify(signedMessage, null, 2)}
</CodeBlock>
</label>
</CopyToClipboard>
</div>
)}
</div>

View File

@ -10,10 +10,10 @@
"npm": ">= 5.0.0"
},
"dependencies": {
"@parity/qr-signer": "0.3.1",
"@ledgerhq/hw-app-eth": "4.7.3",
"@ledgerhq/hw-transport-node-hid": "4.7.6",
"@ledgerhq/hw-transport-u2f": "4.12.0",
"@parity/qr-signer": "0.3.1",
"babel-polyfill": "6.26.0",
"bip39": "2.5.0",
"bn.js": "4.11.8",
@ -40,8 +40,8 @@
"qrcode.react": "0.8.0",
"query-string": "6.0.0",
"rc-slider": "8.6.0",
"react": "16.3.2",
"react-copy-to-clipboard": "5.0.1",
"react": "^16.3.2",
"react-copy-to-clipboard": "^5.0.1",
"react-datetime": "2.14.0",
"react-dom": "16.3.2",
"react-markdown": "3.3.0",

View File

@ -9254,7 +9254,7 @@ rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.1.7, rc@^1.2.1:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
react-copy-to-clipboard@5.0.1:
react-copy-to-clipboard@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.1.tgz#8eae107bb400be73132ed3b6a7b4fb156090208e"
dependencies:
@ -9410,15 +9410,6 @@ react-transition-group@2.3.1:
loose-envify "^1.3.1"
prop-types "^15.6.1"
react@16.3.2:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"
react@^15.3.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72"
@ -9429,6 +9420,15 @@ react@^15.3.2:
object-assign "^4.1.0"
prop-types "^15.5.10"
react@^16.3.2:
version "16.4.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.4.2.tgz#2cd90154e3a9d9dd8da2991149fdca3c260e129f"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"
read-all-stream@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa"