1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-18 07:23:21 +01:00
metamask-extension/ui/app/pages/confirm-deploy-contract/confirm-deploy-contract.component.js

52 lines
1.5 KiB
JavaScript
Raw Normal View History

import React, { Component } from 'react'
import PropTypes from 'prop-types'
import ethUtil from 'ethereumjs-util'
import ConfirmTransactionBase from '../confirm-transaction-base'
export default class ConfirmDeployContract extends Component {
static contextTypes = {
t: PropTypes.func,
}
static propTypes = {
txData: PropTypes.object,
}
2020-11-03 00:41:28 +01:00
renderData() {
const { t } = this.context
2020-11-03 00:41:28 +01:00
const { txData: { origin, txParams: { data } = {} } = {} } = this.props
return (
<div className="confirm-page-container-content__data">
<div className="confirm-page-container-content__data-box">
<div className="confirm-page-container-content__data-field">
<div className="confirm-page-container-content__data-field-label">
2020-11-03 00:41:28 +01:00
{`${t('origin')}:`}
</div>
2020-11-03 00:41:28 +01:00
<div>{origin}</div>
</div>
<div className="confirm-page-container-content__data-field">
<div className="confirm-page-container-content__data-field-label">
2020-11-03 00:41:28 +01:00
{`${t('bytes')}:`}
</div>
2020-11-03 00:41:28 +01:00
<div>{ethUtil.toBuffer(data).length}</div>
</div>
</div>
<div className="confirm-page-container-content__data-box-label">
2020-11-03 00:41:28 +01:00
{`${t('hexData')}:`}
</div>
2020-11-03 00:41:28 +01:00
<div className="confirm-page-container-content__data-box">{data}</div>
</div>
)
}
2020-11-03 00:41:28 +01:00
render() {
return (
<ConfirmTransactionBase
actionKey="contractDeployment"
dataComponent={this.renderData()}
/>
)
}
}