mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
parent
2df185b1a3
commit
1fdbbb844a
3 changed files with 3 additions and 4 deletions
|
|
@ -66,7 +66,7 @@ describe("loopText", () => {
|
|||
const short = "This is a short string.";
|
||||
it("loops long string", () => {
|
||||
const actual = loopText(long);
|
||||
const expected = long + long;
|
||||
const expected = `${long} *** ${long}`;
|
||||
expect(actual).toEqual(expected);
|
||||
});
|
||||
it("does not loop sort strings", () => {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export const pixelUnits = (pixels: number): string => `${pixels}px`;
|
|||
|
||||
// If text is wider than the marquee, it needs to loop
|
||||
export const loopText = (text: string): string =>
|
||||
isLong(text) ? text + text : text.padEnd(MARQUEE_MAX_LENGTH, " ");
|
||||
isLong(text) ? `${text} *** ${text}` : text.padEnd(MARQUEE_MAX_LENGTH, " ");
|
||||
|
||||
class Marquee extends React.Component<Props, State> {
|
||||
stepHandle: NodeJS.Timer | null;
|
||||
|
|
|
|||
|
|
@ -324,8 +324,7 @@ export const getMediaText = createSelector(
|
|||
(minimalMediaText, duration) =>
|
||||
minimalMediaText == null
|
||||
? null
|
||||
: // TODO: Maybe the ` *** ` should actually be added by the marquee
|
||||
`${minimalMediaText} (${Utils.getTimeStr(duration)}) *** `
|
||||
: `${minimalMediaText} (${Utils.getTimeStr(duration)})`
|
||||
);
|
||||
|
||||
export const getNumberOfTracks = (state: AppState) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue