Migrate some toggle buttons to WinampButton

This commit is contained in:
Jordan Eldredge 2022-02-01 00:09:35 -08:00
parent a21850d506
commit a095909a5b
6 changed files with 28 additions and 20 deletions

File diff suppressed because one or more lines are too long

View file

@ -4,6 +4,7 @@ import classnames from "classnames";
import * as Selectors from "../../selectors";
import * as Actions from "../../actionCreators";
import { useActionCreator, useTypedSelector } from "../../hooks";
import WinampButton from "../WinampButton";
function toggleEqualizer() {
return Actions.toggleWindow("equalizer");
@ -13,7 +14,7 @@ const EqToggleButton = memo(() => {
const handleClick = useActionCreator(toggleEqualizer);
const windowOpen = useTypedSelector(Selectors.getWindowOpen)("equalizer");
return (
<div
<WinampButton
id="equalizer-button"
className={classnames({ selected: windowOpen })}
onClick={handleClick}

View file

@ -4,6 +4,7 @@ import classnames from "classnames";
import * as Selectors from "../../selectors";
import * as Actions from "../../actionCreators";
import { useTypedSelector, useActionCreator } from "../../hooks";
import WinampButton from "../WinampButton";
function togglePlaylist() {
return Actions.toggleWindow("playlist");
@ -13,7 +14,7 @@ const PlaylistToggleButton = memo(() => {
const selected = useTypedSelector(Selectors.getWindowOpen)("playlist");
const handleClick = useActionCreator(togglePlaylist);
return (
<div
<WinampButton
id="playlist-button"
className={classnames({ selected })}
onClick={handleClick}

View file

@ -5,6 +5,7 @@ import * as Selectors from "../../selectors";
import ContextMenuWraper from "../ContextMenuWrapper";
import { Node } from "../ContextMenu";
import { useTypedSelector, useActionCreator } from "../../hooks";
import WinampButton from "../WinampButton";
const Repeat = memo(() => {
const repeat = useTypedSelector(Selectors.getRepeat);
@ -20,7 +21,7 @@ const Repeat = memo(() => {
/>
)}
>
<div
<WinampButton
id="repeat"
className={classnames({ selected: repeat })}
onClick={handleClick}

View file

@ -5,6 +5,7 @@ import * as Selectors from "../../selectors";
import ContextMenuWraper from "../ContextMenuWrapper";
import { Node } from "../ContextMenu";
import { useTypedSelector, useActionCreator } from "../../hooks";
import WinampButton from "../WinampButton";
const Shuffle = memo(() => {
const shuffle = useTypedSelector(Selectors.getShuffle);
@ -20,7 +21,7 @@ const Shuffle = memo(() => {
/>
)}
>
<div
<WinampButton
id="shuffle"
className={classnames({ selected: shuffle })}
onClick={handleClick}

View file

@ -223,21 +223,25 @@ export const imageSelectors: Selectors = {
"#position:active::-moz-range-thumb",
],
MAIN_SHUFFLE_BUTTON: ["#shuffle"],
MAIN_SHUFFLE_BUTTON_DEPRESSED: ["#shuffle:active"],
MAIN_SHUFFLE_BUTTON_DEPRESSED: ["#shuffle.winamp-active"],
MAIN_SHUFFLE_BUTTON_SELECTED: ["#shuffle.selected"],
MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED: ["#shuffle.selected:active"],
MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED: ["#shuffle.selected.winamp-active"],
MAIN_REPEAT_BUTTON: ["#repeat"],
MAIN_REPEAT_BUTTON_DEPRESSED: ["#repeat:active"],
MAIN_REPEAT_BUTTON_DEPRESSED: ["#repeat.winamp-active"],
MAIN_REPEAT_BUTTON_SELECTED: ["#repeat.selected"],
MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED: ["#repeat.selected:active"],
MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED: ["#repeat.selected.winamp-active"],
MAIN_EQ_BUTTON: ["#equalizer-button"],
MAIN_EQ_BUTTON_SELECTED: ["#equalizer-button.selected"],
MAIN_EQ_BUTTON_DEPRESSED: ["#equalizer-button:active"],
MAIN_EQ_BUTTON_DEPRESSED_SELECTED: ["#equalizer-button.selected:active"],
MAIN_EQ_BUTTON_DEPRESSED: ["#equalizer-button.winamp-active"],
MAIN_EQ_BUTTON_DEPRESSED_SELECTED: [
"#equalizer-button.selected.winamp-button",
],
MAIN_PLAYLIST_BUTTON: ["#playlist-button"],
MAIN_PLAYLIST_BUTTON_SELECTED: ["#playlist-button.selected"],
MAIN_PLAYLIST_BUTTON_DEPRESSED: ["#playlist-button:active"],
MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED: ["#playlist-button.selected:active"],
MAIN_PLAYLIST_BUTTON_DEPRESSED: ["#playlist-button.winamp-active"],
MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED: [
"#playlist-button.selected.winamp-active",
],
MAIN_TITLE_BAR: ["#title-bar"],
MAIN_TITLE_BAR_SELECTED: [".selected #title-bar"],
MAIN_EASTER_EGG_TITLE_BAR: [".llama #title-bar"],