Time.jsx 565 B

123456789101112131415161718192021222324
  1. import React, { Component } from "react";
  2. import PropTypes from "prop-types";
  3. import { formatTime } from "utils";
  4. import { connect } from "react-redux";
  5. @connect(state => ({
  6. duration: state.station.currentSong.getIn(["timings", "duration"]),
  7. timeElapsed: state.station.currentSong.getIn(["timings", "timeElapsed"]),
  8. }))
  9. export default class Time extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. render() {
  14. return (
  15. <span className="time">
  16. { formatTime(this.props.timeElapsed) } / { formatTime(this.props.duration) }
  17. </span>
  18. );
  19. }
  20. }