aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/time-remaining/time-remaining.component.js
blob: 826d41f9c174b2decb99e59f342577e46e1d0f95 (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
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { getTimeBreakdown } from './time-remaining.utils'

export default class TimeRemaining extends Component {
  static contextTypes = {
    t: PropTypes.func,
  }

  static propTypes = {
    milliseconds: PropTypes.number,
  }

  render () {
    const {
      milliseconds,
    } = this.props

    const {
      minutes,
      seconds,
    } = getTimeBreakdown(milliseconds)

    return (
      <div className="time-remaining">
        <span className="minutes-num">{minutes}</span>
        <span className="minutes-label">{this.context.t('minutesShorthand')}</span>
        <span className="seconds-num">{seconds}</span>
        <span className="seconds-label">{this.context.t('secondsShorthand')}</span>
      </div>
    )
  }
}