From ddf11011c9467209e6b9810dff2df84ea9e4a040 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 25 Oct 2017 21:58:56 -0230 Subject: Signature request fixes. --- app/scripts/lib/notification-manager.js | 2 +- ui/app/components/signature-request.js | 22 +++++++++++----- ui/app/conf-tx.js | 2 +- ui/app/css/itcss/components/request-signature.scss | 30 +++++++++------------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 7846ef7f0..98cd3f760 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -1,5 +1,5 @@ const extension = require('extensionizer') -const height = 520 +const height = 610 const width = 360 diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index 4df4f9193..35a739a8f 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -156,20 +156,24 @@ SignatureRequest.prototype.msgHexToText = function (hex) { SignatureRequest.prototype.renderBody = function () { let rows + let notice = 'You are signing:' const { txData } = this.props const { type, msgParams: { data } } = txData if (type === 'personal_sign') { - rows = [{ name: 'Message:', value: this.msgHexToText(data) }] + rows = [{ name: 'Message', value: this.msgHexToText(data) }] } else if (type === 'eth_signTypedData') { rows = data } - // given the warning in './pending-msg.js', eth_sign' has not been implemented on NewUI-flat at this time - // else if (type === 'eth_sign') { - // console.log('Not currently supported') - // } + 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. ` + } return h('div.request-signature__body', {}, [ @@ -177,7 +181,7 @@ SignatureRequest.prototype.renderBody = function () { this.renderRequestInfo(), - h('div.request-signature__notice', ['You are signing:']), + h('div.request-signature__notice', [notice]), h('div.request-signature__rows', [ @@ -200,6 +204,8 @@ SignatureRequest.prototype.renderFooter = function () { signTypedMessage, cancelPersonalMessage, cancelTypedMessage, + signMessage, + cancelMessage, } = this.props const { txData } = this.props @@ -215,6 +221,10 @@ SignatureRequest.prototype.renderFooter = function () { cancel = cancelTypedMessage sign = signTypedMessage } + else if (type === 'eth_sign') { + cancel = cancelMessage + sign = signMessage + } return h('div.request-signature__footer', [ h('div.request-signature__footer__cancel-button', { diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index fb5d2c0cf..97e0646e8 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -121,7 +121,7 @@ function currentTxView (opts) { return h(PendingTx, opts) } else if (msgParams) { log.debug('msgParams detected, rendering pending msg') - + return h(SignatureRequest, opts) // if (type === 'eth_sign') { diff --git a/ui/app/css/itcss/components/request-signature.scss b/ui/app/css/itcss/components/request-signature.scss index 27882d83c..e9ba7dbfd 100644 --- a/ui/app/css/itcss/components/request-signature.scss +++ b/ui/app/css/itcss/components/request-signature.scss @@ -1,6 +1,5 @@ .request-signature { &__container { - height: 619px; width: 380px; border-radius: 8px; background-color: $white; @@ -11,6 +10,7 @@ align-items: center; font-family: Roboto; position: relative; + height: 100%; @media screen and (max-width: $break-small) { width: 100%; @@ -68,7 +68,7 @@ display: flex; justify-content: space-between; margin-top: 18px; - height: 69px; + margin-bottom: 20px; } &__account { @@ -97,11 +97,14 @@ } &__request-icon { - align-self: flex-end; + margin-top: 25px; } &__body { width: 100%; + height: 100%; + display: flex; + flex-flow: column; } &__request-info { @@ -122,42 +125,33 @@ } &__notice { - height: 19px; - width: 105px; color: #9B9B9B; font-family: "Avenir Next"; font-size: 14px; line-height: 19px; text-align: center; - margin-top: 21px; + margin-top: 41px; margin-bottom: 11px; width: 100%; } &__rows { - height: 262px; + height: 100%; overflow-y: scroll; overflow-x: hidden; border-top: 1px solid $geyser; - - @media screen and (max-width: $break-small) { - height: 208px; - } + display: flex; + flex-flow: column; + padding-right: 4px; } - // &__rows::-webkit-scrollbar { - // display: none; - // } - &__row { - height: 74px; display: flex; flex-flow: column; border-bottom: 1px solid $geyser; } &__row-title { - height: 22px; width: 80px; color: $dusty-gray; font-family: Roboto; @@ -169,7 +163,6 @@ } &__row-value { - height: 19px; color: $scorpion; font-family: Roboto; font-size: 14px; @@ -178,6 +171,7 @@ margin-bottom: 15px; margin-left: 18px; width: 95%; + overflow-wrap: break-word; } &__footer { -- cgit