Type SelectionMenu

This commit is contained in:
Jordan Eldredge 2018-10-10 20:34:41 -07:00
parent da4963d2c1
commit 438ca38c5c

View file

@ -2,8 +2,15 @@ import React from "react";
import { connect } from "react-redux";
import { SELECT_ALL, SELECT_ZERO, INVERT_SELECTION } from "../../actionTypes";
import PlaylistMenu from "./PlaylistMenu";
import { Dispatch } from "../../types";
const SelectionMenu = props => (
interface DispatchProps {
invertSelection: () => void;
selectZero: () => void;
selectAll: () => void;
}
const SelectionMenu = (props: DispatchProps) => (
<PlaylistMenu id="playlist-selection-menu">
<div className="invert-selection" onClick={props.invertSelection} />
<div className="select-zero" onClick={props.selectZero} />
@ -11,10 +18,12 @@ const SelectionMenu = props => (
</PlaylistMenu>
);
const mapDispatchToProps = {
invertSelection: () => ({ type: INVERT_SELECTION }),
selectAll: () => ({ type: SELECT_ALL }),
selectZero: () => ({ type: SELECT_ZERO })
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
return {
invertSelection: () => dispatch({ type: INVERT_SELECTION }),
selectAll: () => dispatch({ type: SELECT_ALL }),
selectZero: () => dispatch({ type: SELECT_ZERO })
};
};
export default connect(
null,