mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Type Repeat
This commit is contained in:
parent
7d9ef4287f
commit
107a4cee1b
1 changed files with 14 additions and 3 deletions
|
|
@ -4,8 +4,19 @@ import classnames from "classnames";
|
|||
import { toggleRepeat } from "../../actionCreators";
|
||||
import ContextMenuWraper from "../ContextMenuWrapper";
|
||||
import { Node } from "../ContextMenu";
|
||||
import { AppState, Dispatch } from "../../types";
|
||||
|
||||
const Repeat = ({ repeat, handleClick }) => (
|
||||
interface StateProps {
|
||||
repeat: boolean;
|
||||
}
|
||||
|
||||
interface DispatchProps {
|
||||
handleClick(): void;
|
||||
}
|
||||
|
||||
type Props = StateProps & DispatchProps;
|
||||
|
||||
const Repeat = ({ repeat, handleClick }: Props) => (
|
||||
<ContextMenuWraper
|
||||
renderContents={() => (
|
||||
<Node
|
||||
|
|
@ -25,11 +36,11 @@ const Repeat = ({ repeat, handleClick }) => (
|
|||
</ContextMenuWraper>
|
||||
);
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
const mapStateToProps = (state: AppState): StateProps => ({
|
||||
repeat: state.media.repeat
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
|
||||
handleClick: () => dispatch(toggleRepeat())
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue