From 921134bad1ddb69f42fa55cc32b0becdbc91fb09 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 25 Nov 2019 10:03:30 -0330 Subject: [PATCH] Convert ConfirmTxScreen component to use JSX (#7559) --- ui/app/pages/confirm-transaction/conf-tx.js | 49 ++++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/ui/app/pages/confirm-transaction/conf-tx.js b/ui/app/pages/confirm-transaction/conf-tx.js index 79d7f5e4f..5d8069d91 100644 --- a/ui/app/pages/confirm-transaction/conf-tx.js +++ b/ui/app/pages/confirm-transaction/conf-tx.js @@ -1,6 +1,5 @@ +import React, {Component} from 'react' const inherits = require('util').inherits -const Component = require('react').Component -const h = require('react-hyperscript') const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') const { compose } = require('recompose') @@ -148,35 +147,41 @@ ConfirmTxScreen.prototype.signatureSelect = function (type, version) { } ConfirmTxScreen.prototype.render = function () { - const props = this.props const { currentCurrency, blockGasLimit, conversionRate, - } = props + } = this.props var txData = this.getTxData() || {} const { msgParams, type, msgParams: { version } } = txData log.debug('msgParams detected, rendering pending msg') - return msgParams ? h(this.signatureSelect(type, version), { - // Properties - txData: txData, - key: txData.id, - selectedAddress: props.selectedAddress, - accounts: props.accounts, - identities: props.identities, - conversionRate, - currentCurrency, - blockGasLimit, - // Actions - signMessage: this.signMessage.bind(this, txData), - signPersonalMessage: this.signPersonalMessage.bind(this, txData), - signTypedMessage: this.signTypedMessage.bind(this, txData), - cancelMessage: this.cancelMessage.bind(this, txData), - cancelPersonalMessage: this.cancelPersonalMessage.bind(this, txData), - cancelTypedMessage: this.cancelTypedMessage.bind(this, txData), - }) : h(Loading) + if (!msgParams) { + return ( + + ) + } + + const SigComponent = this.signatureSelect(type, version) + return ( + + ) } ConfirmTxScreen.prototype.signMessage = function (msgData, event) {