Remove unused `time-remaining` component (#6912)
The `time-remaining` component hasn't been used since #5704, aside from a few styles. Those styles have been integrated into the `advanced-tab-content` styles, and the unused component has been deleted.feature/default_network_editable
parent
429030a00e
commit
74639ab3ae
@ -1 +0,0 @@ |
||||
export { default } from './time-remaining.component' |
@ -1,17 +0,0 @@ |
||||
.time-remaining { |
||||
color: #313A5E; |
||||
font-size: 16px; |
||||
|
||||
.minutes-num, .seconds-num { |
||||
font-size: 16px; |
||||
} |
||||
|
||||
.seconds-num { |
||||
margin-left: 7px; |
||||
font-size: 16px; |
||||
} |
||||
|
||||
.minutes-label, .seconds-label { |
||||
font-size: 16px; |
||||
} |
||||
} |
@ -1,30 +0,0 @@ |
||||
import React from 'react' |
||||
import assert from 'assert' |
||||
import shallow from '../../../../../../../../lib/shallow-with-context' |
||||
import TimeRemaining from '../time-remaining.component.js' |
||||
|
||||
describe('TimeRemaining Component', function () { |
||||
let wrapper |
||||
|
||||
beforeEach(() => { |
||||
wrapper = shallow(<TimeRemaining |
||||
milliseconds={495000} |
||||
/>) |
||||
}) |
||||
|
||||
describe('render()', () => { |
||||
it('should render the time-remaining root node', () => { |
||||
assert(wrapper.hasClass('time-remaining')) |
||||
}) |
||||
|
||||
it('should render minutes and seconds numbers and labels', () => { |
||||
const timeRemainingChildren = wrapper.children() |
||||
assert.equal(timeRemainingChildren.length, 4) |
||||
assert.equal(timeRemainingChildren.at(0).text(), 8) |
||||
assert.equal(timeRemainingChildren.at(1).text(), 'minutesShorthand') |
||||
assert.equal(timeRemainingChildren.at(2).text(), 15) |
||||
assert.equal(timeRemainingChildren.at(3).text(), 'secondsShorthand') |
||||
}) |
||||
}) |
||||
|
||||
}) |
@ -1,33 +0,0 @@ |
||||
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> |
||||
) |
||||
} |
||||
} |
@ -1,11 +0,0 @@ |
||||
function getTimeBreakdown (milliseconds) { |
||||
return { |
||||
hours: Math.floor(milliseconds / 3600000), |
||||
minutes: Math.floor((milliseconds % 3600000) / 60000), |
||||
seconds: Math.floor((milliseconds % 60000) / 1000), |
||||
} |
||||
} |
||||
|
||||
module.exports = { |
||||
getTimeBreakdown, |
||||
} |
Loading…
Reference in new issue