mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-19 01:23:49 +00:00
Type Shuffle
This commit is contained in:
parent
107a4cee1b
commit
eb296fc182
1 changed files with 14 additions and 3 deletions
|
|
@ -4,8 +4,18 @@ import classnames from "classnames";
|
|||
import { toggleShuffle } from "../../actionCreators";
|
||||
import ContextMenuWraper from "../ContextMenuWrapper";
|
||||
import { Node } from "../ContextMenu";
|
||||
import { Dispatch, AppState } from "../../types";
|
||||
|
||||
const Shuffle = ({ shuffle, handleClick }) => (
|
||||
interface StateProps {
|
||||
shuffle: boolean;
|
||||
}
|
||||
|
||||
interface DispatchProps {
|
||||
handleClick(): void;
|
||||
}
|
||||
|
||||
type Props = StateProps & DispatchProps;
|
||||
const Shuffle = ({ shuffle, handleClick }: Props) => (
|
||||
<ContextMenuWraper
|
||||
renderContents={() => (
|
||||
<Node
|
||||
|
|
@ -24,11 +34,12 @@ const Shuffle = ({ shuffle, handleClick }) => (
|
|||
/>
|
||||
</ContextMenuWraper>
|
||||
);
|
||||
const mapStateToProps = state => ({
|
||||
|
||||
const mapStateToProps = (state: AppState): StateProps => ({
|
||||
shuffle: state.media.shuffle
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
|
||||
handleClick: () => dispatch(toggleShuffle())
|
||||
});
|
||||
export default connect(
|
||||
Loading…
Add table
Add a link
Reference in a new issue