mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
25 lines
699 B
TypeScript
25 lines
699 B
TypeScript
import React from "react";
|
|
import classnames from "classnames";
|
|
|
|
import * as Selectors from "../../selectors";
|
|
import * as Actions from "../../actionCreators";
|
|
import { useActionCreator, useTypedSelector } from "../../hooks";
|
|
|
|
function toggleEqualizer() {
|
|
return Actions.toggleWindow("equalizer");
|
|
}
|
|
|
|
const EqToggleButton = React.memo(() => {
|
|
const handleClick = useActionCreator(toggleEqualizer);
|
|
const windowOpen = useTypedSelector(Selectors.getWindowOpen)("equalizer");
|
|
return (
|
|
<div
|
|
id="equalizer-button"
|
|
className={classnames({ selected: windowOpen })}
|
|
onClick={handleClick}
|
|
title="Toggle Graphical Equalizer"
|
|
/>
|
|
);
|
|
});
|
|
|
|
export default EqToggleButton;
|