mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
28 lines
668 B
JavaScript
28 lines
668 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.selected })}
|
|
onClick={props.handleClick}
|
|
title="Toggle Playlist Editor"
|
|
/>
|
|
);
|
|
|
|
const mapStateToProps = state => ({
|
|
selected: getWindowOpen(state)("playlist"),
|
|
});
|
|
|
|
const mapDispatchToProps = {
|
|
handleClick: () => toggleWindow("playlist"),
|
|
};
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(PlaylistToggleButton);
|