mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
Type SelectionMenu
This commit is contained in:
parent
da4963d2c1
commit
438ca38c5c
1 changed files with 14 additions and 5 deletions
|
|
@ -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,
|
||||
Loading…
Add table
Add a link
Reference in a new issue