import React from 'react'; import {connect} from 'react-redux'; import {getTimeObj} from './utils'; class Time extends React.Component { constructor(props) { super(props); this.toggleTimeMode = this.toggleTimeMode.bind(this); } toggleTimeMode() { this.props.dispatch({type: 'TOGGLE_TIME_MODE'}); } render() { const seconds = this.props.timeMode === 'ELAPSED' ? this.props.timeElapsed : this.props.length - this.props.timeElapsed; const timeObj = getTimeObj(seconds); return