1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 20:05:27 +02:00
metamask-extension/ui/app/components/send/send-content/send-gas-row/send-gas-row.component.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-04-11 16:21:54 +02:00
import React, { Component } from 'react'
import PropTypes from 'prop-types'
2018-05-15 14:29:23 +02:00
import SendRowWrapper from '../send-row-wrapper/'
import GasFeeDisplay from './gas-fee-display/gas-fee-display.component'
2018-04-11 16:21:54 +02:00
export default class SendGasRow extends Component {
static propTypes = {
2018-04-26 18:38:38 +02:00
conversionRate: PropTypes.number,
convertedCurrency: PropTypes.string,
2018-06-29 19:19:40 +02:00
gasFeeError: PropTypes.bool,
gasLoadingError: PropTypes.bool,
gasTotal: PropTypes.string,
2018-04-27 12:41:18 +02:00
showCustomizeGasModal: PropTypes.func,
2018-04-11 16:21:54 +02:00
};
static contextTypes = {
t: PropTypes.func,
};
2018-04-11 16:21:54 +02:00
render () {
const {
conversionRate,
convertedCurrency,
gasLoadingError,
gasTotal,
2018-06-29 19:19:40 +02:00
gasFeeError,
showCustomizeGasModal,
2018-04-11 16:21:54 +02:00
} = this.props
return (
2018-06-29 19:19:40 +02:00
<SendRowWrapper
label={`${this.context.t('gasFee')}:`}
showError={gasFeeError}
errorType={'gasFee'}
>
2018-04-11 16:21:54 +02:00
<GasFeeDisplay
2018-04-26 18:38:38 +02:00
conversionRate={conversionRate}
convertedCurrency={convertedCurrency}
gasLoadingError={gasLoadingError}
gasTotal={gasTotal}
onClick={() => showCustomizeGasModal()}
2018-04-11 16:21:54 +02:00
/>
</SendRowWrapper>
)
2018-04-11 16:21:54 +02:00
}
}