diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-03-27 15:20:35 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-03-27 15:20:35 +0800 |
commit | 6f367a5a6b4fb8918405f233293dc3f4840b4a3d (patch) | |
tree | c60c01300c90204f8634d1f3e9e79b4ecc2fceda /ui/app/components/pages/signature-request.js | |
parent | 72ffa2c3f5abbcb06c8ab5fdf20b9d934c330692 (diff) | |
parent | e001c0900b5256c0c8769f0c3eb5d2007f5b18d3 (diff) | |
download | tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.tar tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.tar.gz tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.tar.bz2 tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.tar.lz tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.tar.xz tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.tar.zst tangerine-wallet-browser-6f367a5a6b4fb8918405f233293dc3f4840b4a3d.zip |
Fix merge conflicts
Diffstat (limited to 'ui/app/components/pages/signature-request.js')
-rw-r--r-- | ui/app/components/pages/signature-request.js | 75 |
1 files changed, 19 insertions, 56 deletions
diff --git a/ui/app/components/pages/signature-request.js b/ui/app/components/pages/signature-request.js index 0c9f4a091..2e7f3ea20 100644 --- a/ui/app/components/pages/signature-request.js +++ b/ui/app/components/pages/signature-request.js @@ -8,9 +8,8 @@ const classnames = require('classnames') const AccountDropdownMini = require('../dropdowns/account-dropdown-mini') -const actions = require('../../actions') +const t = require('../../i18n') const { conversionUtil } = require('../../conversion-util') -const txHelper = require('../../../lib/tx-helper') const { DEFAULT_ROUTE } = require('../../routes') const { @@ -48,7 +47,7 @@ class SignatureRequest extends Component { h('div.request-signature__header-background'), - h('div.request-signature__header__text', 'Signature Request'), + h('div.request-signature__header__text', t('sigRequest')), h('div.request-signature__header__tip-container', [ h('div.request-signature__header__tip'), @@ -67,7 +66,7 @@ class SignatureRequest extends Component { return h('div.request-signature__account', [ - h('div.request-signature__account-text', ['Account:']), + h('div.request-signature__account-text', [t('account') + ':']), h(AccountDropdownMini, { selectedAccount, @@ -94,7 +93,7 @@ class SignatureRequest extends Component { return h('div.request-signature__balance', [ - h('div.request-signature__balance-text', ['Balance:']), + h('div.request-signature__balance-text', [t('balance')]), h('div.request-signature__balance-value', `${balanceInEther} ETH`), @@ -128,7 +127,7 @@ class SignatureRequest extends Component { return h('div.request-signature__request-info', [ h('div.request-signature__headline', [ - `Your signature is being requested`, + t('yourSigRequested'), ]), ]) @@ -145,23 +144,19 @@ class SignatureRequest extends Component { } renderBody () { - let rows = [] - let notice = 'You are signing:' + let rows + let notice = t('youSign') + ':' - const { txData = {} } = this.props - const { type, msgParams = {} } = txData - const { data } = msgParams + const { txData } = this.props + const { type, msgParams: { data } } = txData if (type === 'personal_sign') { - rows = [{ name: 'Message', value: this.msgHexToText(data) }] + rows = [{ name: t('message'), value: this.msgHexToText(data) }] } else if (type === 'eth_signTypedData') { rows = data } else if (type === 'eth_sign') { - rows = [{ name: 'Message', value: data }] - notice = `Signing this message can have - dangerous side effects. Only sign messages from - sites you fully trust with your entire account. - This dangerous method will be removed in a future version. ` + rows = [{ name: t('message'), value: data }] + notice = t('signNotice') } return h('div.request-signature__body', {}, [ @@ -227,16 +222,16 @@ class SignatureRequest extends Component { } return h('div.request-signature__footer', [ - h('button.request-signature__footer__cancel-button', { + h('button.btn-secondary--lg.request-signature__footer__cancel-button', { onClick: () => { cancel().then(() => history.push(DEFAULT_ROUTE)) }, - }, 'CANCEL'), - h('button.request-signature__footer__sign-button', { + }, t('cancel')), + h('button.btn-primary--lg', { onClick: () => { sign().then(() => history.push(DEFAULT_ROUTE)) }, - }, 'SIGN'), + }, t('sign')), ]) } @@ -275,47 +270,15 @@ SignatureRequest.propTypes = { } const mapStateToProps = state => { - const { metamask } = state - const { - unapprovedTxs, - unapprovedMsgs, - unapprovedPersonalMsgs, - unapprovedTypedMessages, - network, - unapprovedMsgCount, - unapprovedPersonalMsgCount, - unapprovedTypedMessagesCount, - } = metamask - const unconfTxList = txHelper( - unapprovedTxs, - unapprovedMsgs, - unapprovedPersonalMsgs, - unapprovedTypedMessages, - network - ) || [] - return { balance: getSelectedAccount(state).balance, selectedAccount: getCurrentAccountWithSendEtherInfo(state), selectedAddress: getSelectedAddress(state), + requester: null, + requesterAddress: null, accounts: accountsWithSendEtherInfoSelector(state), conversionRate: conversionRateSelector(state), - unapprovedMsgCount, - unapprovedPersonalMsgCount, - unapprovedTypedMessagesCount, - txData: unconfTxList[0] || {}, - } -} - -const mapDispatchToProps = dispatch => { - return { - signPersonalMessage: params => dispatch(actions.signPersonalMsg(params)), - cancelPersonalMessage: params => dispatch(actions.cancelPersonalMsg(params)), - signTypedMessage: params => dispatch(actions.signTypedMsg(params)), - cancelTypedMessage: params => dispatch(actions.cancelTypedMsg(params)), - signMessage: params => dispatch(actions.signMsg(params)), - cancelMessage: params => dispatch(actions.cancelMsg(params)), } } -module.exports = connect(mapStateToProps, mapDispatchToProps)(SignatureRequest) +module.exports = connect(mapStateToProps)(SignatureRequest) |