-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New signature request v3 UI #6891
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good overall. I've made a few suggestions here.
Once the styles are updated again according to the figma, I will do another review
@@ -273,8 +273,7 @@ SignatureRequest.prototype.renderBody = function () { | |||
}), | |||
}, [notice]), | |||
|
|||
h('div.request-signature__rows', type === 'eth_signTypedData' && version === 'V3' ? | |||
this.renderTypedDataV3(data) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should delete the this.renderTypedDataV3
method too? No longer needed here, correct?
<div className="signature-request-header"> | ||
<div className="signature-request-header--account"> | ||
{selectedAccount && accounts && <AccountDropdownMini | ||
selectedAccount={selectedAccount} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this selectedAccount
is the current account. I think you mentioned you weren't sure where to get that from state
...nents/app/signature-request/signature-request-message/signature-request-message.component.js
Show resolved
Hide resolved
e6159bf
to
6eac8d3
Compare
if (typeof value === 'boolean') { | ||
value = value.toString() | ||
} | ||
return h('div.request-signature__row', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put a key prop on each of these rows? Minimally we could be using the index?
export default class SignatureRequestHeader extends PureComponent { | ||
static propTypes = { | ||
selectedAccount: PropTypes.object.isRequired, | ||
accounts: PropTypes.object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this prop isn't required we should include a defaultProp
for it
|
||
render () { | ||
const { selectedAccount } = this.props | ||
console.log('selectedAccount', selectedAccount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: console.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c8120c6dac920b8a64d46fce781d099aa398c8b1
...nents/app/signature-request/signature-request-message/signature-request-message.component.js
Show resolved
Hide resolved
address: PropTypes.string, | ||
balance: PropTypes.string, | ||
}) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this prop isn't required, we should add a defaultProp
for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still pending
@@ -137,34 +138,46 @@ ConfirmTxScreen.prototype.getTxData = function () { | |||
: unconfTxList[index] | |||
} | |||
|
|||
ConfirmTxScreen.prototype.signatureSelect = function (type, version) { | |||
// Temporarily direct only v3 and v4 requests to new code. | |||
console.log('type, version', type, version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: console.log
cancelTypedMessage: this.cancelTypedMessage.bind(this, txData), | ||
}) | ||
: h(Loading) | ||
console.log('msgParams', msgParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: console.log
@@ -118,7 +119,7 @@ export default class ConfirmTransaction extends Component { | |||
// Show routes when state.confirmTransaction has been set and when either the ID in the params | |||
// isn't specified or is specified and matches the ID in state.confirmTransaction in order to | |||
// support URLs of /confirm-transaction or /confirm-transaction/<transactionId> | |||
|
|||
console.log('transactionId, paramsTransactionId', transactionId, paramsTransactionId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: console.log
ui/app/pages/home/home.component.js
Outdated
@@ -97,7 +97,7 @@ export default class Home extends PureComponent { | |||
showRestorePrompt, | |||
threeBoxLastUpdated, | |||
} = this.props | |||
|
|||
console.log(123456) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: console.log
ui/index.js
Outdated
@@ -60,6 +60,7 @@ async function startApp (metamaskState, backgroundConnection, opts) { | |||
const unapprovedTxsAll = txHelper(metamaskState.unapprovedTxs, metamaskState.unapprovedMsgs, metamaskState.unapprovedPersonalMsgs, metamaskState.unapprovedTypedMessages, metamaskState.network) | |||
const numberOfUnapprivedTx = unapprovedTxsAll.length | |||
if (numberOfUnapprivedTx > 0) { | |||
console.log('unapprovedTxsAll', unapprovedTxsAll) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: console.log
6eac8d3
to
d223915
Compare
@whymarrh All comments (except the question about the whether the array label issue was resolved) were resolved in c8120c6dac920b8a64d46fce781d099aa398c8b1 I also fixed the styling of the component in full screen mode in d223915e1a02b9c8ce0905aa24e653f2a6db8705 Looking into that array label issue now |
And I left a comment regarding the array label issue |
renderNode (data) { | ||
return ( | ||
<div className="signature-request-message--node"> | ||
{this.makeNode(data).map(([ label, value ], i) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the looks of it, makeNode
does nothing more than return the result of Object.entries
, so this could be a call to that method directly.
{this.makeNode(data).map(([ label, value ], i) => ( | |
{Object.entries(data).map(([ label, value ], i) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we should be able to remove makeNode
since it's just the once instance
address: PropTypes.string, | ||
balance: PropTypes.string, | ||
}) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still pending
const { clearConfirmTransaction, cancel } = this.props | ||
const { metricsEvent } = this.context | ||
if (getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_NOTIFICATION) { | ||
window.onbeforeunload = event => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danjm want to rebase this on the latest |
fcde372
to
5ec78d9
Compare
@danjm this build is still failing |
5ec78d9
to
2fe6133
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -45,6 +45,7 @@ export default class ConfirmTransaction extends Component { | |||
isTokenMethodAction: PropTypes.bool, | |||
fullScreenVsPopupTestGroup: PropTypes.string, | |||
trackABTest: PropTypes.bool, | |||
conversionRate: PropTypes.number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the post-merge nitpick, but this prop appears to be unused (both here and in the container component)
This comment has been minimized.
This comment has been minimized.
* Refactoring signature-request out to a new component. Wip * Styling polish and a better message display. * Update signature request header to no longer use account dropdown mini * Clean up code and styles * Code cleanup for signature request redesign branch * Fix signature request design for full screen * Replace makenode with object.entries in signature-request-message.component.js * Remove unused accounts prop from signature-request.component.js * Use beforeunload instead of window.onbeforeunload in signature-request
The header component for the new Signature Request screen has an undeclared variable called `name` in it. This was present in the original implementation of this component in #6891. It's unclear what this was supposed to be, and it doesn't seem to reference anything that exists.
The header component for the new Signature Request screen has an undeclared variable called `name` in it. This was present in the original implementation of this component in #6891. It's unclear what this was supposed to be, and it doesn't seem to reference anything that exists.
Work in progress
In this PR I've extracted the old Signature request component into a new component to follow newer practices.
Todo's
This work refers to #5388