1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 11:46:13 +02:00
metamask-extension/ui/app/pages/send/send-content/send-content.component.js
Whymarrh Whitby c1e3c229bc
Fix import/order issues (#9239)
See [`import/order`](https://eslint.org/docs/rules/import/order) for more information.

This change enables `import/order` and fixes the issues raised by the rule.
2020-08-18 16:48:25 -02:30

65 lines
1.6 KiB
JavaScript

import React, { Component } from 'react'
import PropTypes from 'prop-types'
import PageContainerContent from '../../../components/ui/page-container/page-container-content.component'
import Dialog from '../../../components/ui/dialog'
import SendAmountRow from './send-amount-row'
import SendGasRow from './send-gas-row'
import SendHexDataRow from './send-hex-data-row'
import SendAssetRow from './send-asset-row'
export default class SendContent extends Component {
static contextTypes = {
t: PropTypes.func,
}
static propTypes = {
updateGas: PropTypes.func,
showAddToAddressBookModal: PropTypes.func,
showHexData: PropTypes.bool,
contact: PropTypes.object,
isOwnedAccount: PropTypes.bool,
}
updateGas = (updateData) => this.props.updateGas(updateData)
render () {
return (
<PageContainerContent>
<div className="send-v2__form">
{ this.maybeRenderAddContact() }
<SendAssetRow />
<SendAmountRow updateGas={this.updateGas} />
<SendGasRow />
{
this.props.showHexData && (
<SendHexDataRow
updateGas={this.updateGas}
/>
)
}
</div>
</PageContainerContent>
)
}
maybeRenderAddContact () {
const { t } = this.context
const { isOwnedAccount, showAddToAddressBookModal, contact = {} } = this.props
if (isOwnedAccount || contact.name) {
return null
}
return (
<Dialog
type="message"
className="send__dialog"
onClick={showAddToAddressBookModal}
>
{t('newAccountDetectedDialogMessage')}
</Dialog>
)
}
}