mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Type RunningTimeDisplay
This commit is contained in:
parent
2b91e8a0df
commit
da4963d2c1
1 changed files with 8 additions and 3 deletions
|
|
@ -3,18 +3,23 @@ import { connect } from "react-redux";
|
|||
|
||||
import CharacterString from "../CharacterString";
|
||||
import { getRunningTimeMessage } from "../../selectors";
|
||||
import { AppState } from "../../types";
|
||||
|
||||
// While all the browsers I care about support String.prototype.padEnd,
|
||||
// Not all node versions do, and I want tests to pass in Jest...
|
||||
// Sigh.
|
||||
function rightPad(str, len, fillChar) {
|
||||
function rightPad(str: string, len: number, fillChar: string): string {
|
||||
while (str.length < len) {
|
||||
str += fillChar;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
const RunningTimeDisplay = props => (
|
||||
interface Props {
|
||||
runningTimeMessage: string;
|
||||
}
|
||||
|
||||
const RunningTimeDisplay = (props: Props) => (
|
||||
<div className="playlist-running-time-display draggable">
|
||||
{/* This div is probably not strictly needed */}
|
||||
<div>
|
||||
|
|
@ -25,7 +30,7 @@ const RunningTimeDisplay = props => (
|
|||
</div>
|
||||
);
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
const mapStateToProps = (state: AppState): Props => ({
|
||||
runningTimeMessage: getRunningTimeMessage(state)
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue