mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 10:15:31 +00:00
25 lines
688 B
JavaScript
25 lines
688 B
JavaScript
import React from "react";
|
|
import classnames from "classnames";
|
|
|
|
import * as Selectors from "../../selectors";
|
|
import * as Actions from "../../actionCreators";
|
|
import { useTypedSelector, useActionCreator } from "../../hooks";
|
|
|
|
function togglePlaylist() {
|
|
return Actions.toggleWindow("playlist");
|
|
}
|
|
|
|
const PlaylistToggleButton = React.memo(() => {
|
|
const selected = useTypedSelector(Selectors.getWindowOpen)("playlist");
|
|
const handleClick = useActionCreator(togglePlaylist);
|
|
return (
|
|
<div
|
|
id="playlist-button"
|
|
className={classnames({ selected })}
|
|
onClick={handleClick}
|
|
title="Toggle Playlist Editor"
|
|
/>
|
|
);
|
|
});
|
|
|
|
export default PlaylistToggleButton;
|