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/'
|
2018-06-21 08:43:48 +02:00
|
|
|
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,
|
2018-04-27 02:38:14 +02:00
|
|
|
convertedCurrency: PropTypes.string,
|
2018-06-29 19:19:40 +02:00
|
|
|
gasFeeError: PropTypes.bool,
|
2018-04-27 02:38:14 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2018-07-02 04:09:28 +02:00
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
2018-04-11 16:21:54 +02:00
|
|
|
render () {
|
|
|
|
const {
|
|
|
|
conversionRate,
|
|
|
|
convertedCurrency,
|
|
|
|
gasLoadingError,
|
2018-04-27 02:38:14 +02:00
|
|
|
gasTotal,
|
2018-06-29 19:19:40 +02:00
|
|
|
gasFeeError,
|
2018-04-27 02:38:14 +02:00
|
|
|
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}
|
2018-04-27 02:38:14 +02:00
|
|
|
gasTotal={gasTotal}
|
|
|
|
onClick={() => showCustomizeGasModal()}
|
2018-04-11 16:21:54 +02:00
|
|
|
/>
|
|
|
|
</SendRowWrapper>
|
2018-04-27 02:38:14 +02:00
|
|
|
)
|
2018-04-11 16:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|