aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-content/send-gas-row/send-gas-row.component.js
blob: c80d8c0bb5c9dae8e48502280cb115610d673f3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import SendRowWrapper from '../send-row-wrapper/'
import GasFeeDisplay from '../../../send/gas-fee-display-v2'

export default class SendGasRow extends Component {

  static propTypes = {
    conversionRate: PropTypes.number,
    convertedCurrency: PropTypes.string,
    gasLoadingError: PropTypes.bool,
    gasTotal: PropTypes.string,
    showCustomizeGasModal: PropTypes.func,
  };

  render () {
    const {
      conversionRate,
      convertedCurrency,
      gasLoadingError,
      gasTotal,
      showCustomizeGasModal,
    } = this.props

    return (
      <SendRowWrapper label={`${this.context.t('gasFee')}:`}>
        <GasFeeDisplay
          conversionRate={conversionRate}
          convertedCurrency={convertedCurrency}
          gasLoadingError={gasLoadingError}
          gasTotal={gasTotal}
          onClick={() => showCustomizeGasModal()}
        />
      </SendRowWrapper>
    )
  }

}

SendGasRow.contextTypes = {
  t: PropTypes.func,
}