mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
27 lines
664 B
JavaScript
27 lines
664 B
JavaScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import classnames from "classnames";
|
|
|
|
import { getWindowOpen } from "../../selectors";
|
|
import { toggleWindow } from "../../actionCreators";
|
|
|
|
const PlaylistToggleButton = props => (
|
|
<div
|
|
id="playlist-button"
|
|
className={classnames({ selected: props.playlist })}
|
|
onClick={props.handleClick}
|
|
title="Toggle Playlist Editor"
|
|
/>
|
|
);
|
|
|
|
const mapStateToProps = state => ({
|
|
playlist: getWindowOpen(state, "playlist")
|
|
});
|
|
|
|
const mapDispatchToProps = {
|
|
handleClick: () => toggleWindow("playlist")
|
|
};
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(
|
|
PlaylistToggleButton
|
|
);
|