diff --git a/js/components/MainWindow/Repeat.js b/js/components/MainWindow/Repeat.tsx similarity index 67% rename from js/components/MainWindow/Repeat.js rename to js/components/MainWindow/Repeat.tsx index 2812a04c..219d84e1 100644 --- a/js/components/MainWindow/Repeat.js +++ b/js/components/MainWindow/Repeat.tsx @@ -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) => ( ( ( ); -const mapStateToProps = state => ({ +const mapStateToProps = (state: AppState): StateProps => ({ repeat: state.media.repeat }); -const mapDispatchToProps = dispatch => ({ +const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ handleClick: () => dispatch(toggleRepeat()) });