mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 19:13:54 +00:00
Type Minimize
This commit is contained in:
parent
839444fe86
commit
5d6b2d40dc
4 changed files with 34 additions and 19 deletions
|
|
@ -2,7 +2,8 @@ import {
|
|||
CLOSE_WINAMP,
|
||||
STOP,
|
||||
TOGGLE_VISUALIZER_STYLE,
|
||||
CLOSE_REQUESTED
|
||||
CLOSE_REQUESTED,
|
||||
MINIMIZE_WINAMP
|
||||
} from "../actionTypes";
|
||||
import { Dispatchable } from "../types";
|
||||
|
||||
|
|
@ -93,3 +94,7 @@ export function close(): Dispatchable {
|
|||
export function toggleVisualizerStyle(): Dispatchable {
|
||||
return { type: TOGGLE_VISUALIZER_STYLE };
|
||||
}
|
||||
|
||||
export function minimize(): Dispatchable {
|
||||
return { type: MINIMIZE_WINAMP };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
|
||||
interface Props {
|
||||
type DivProps = React.DetailedHTMLProps<
|
||||
React.HTMLAttributes<HTMLDivElement>,
|
||||
HTMLDivElement
|
||||
>;
|
||||
|
||||
interface Props extends DivProps {
|
||||
className?: string;
|
||||
onMouseDown?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import ClickedDiv from "../ClickedDiv";
|
||||
import { MINIMIZE_WINAMP } from "../../actionTypes";
|
||||
|
||||
const Minimize = ({ minimize }) => (
|
||||
<ClickedDiv id="minimize" title="Minimize" onClick={minimize} />
|
||||
);
|
||||
|
||||
const mapDispatchToProps = {
|
||||
minimize: () => ({ type: MINIMIZE_WINAMP })
|
||||
};
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
mapDispatchToProps
|
||||
)(Minimize);
|
||||
22
js/components/MainWindow/Minimize.tsx
Normal file
22
js/components/MainWindow/Minimize.tsx
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import ClickedDiv from "../ClickedDiv";
|
||||
import * as Actions from "../../actionCreators";
|
||||
import { Dispatch } from "../../types";
|
||||
|
||||
interface Props {
|
||||
minimize(): void;
|
||||
}
|
||||
|
||||
const Minimize = ({ minimize }: Props) => (
|
||||
<ClickedDiv id="minimize" title="Minimize" onClick={minimize} />
|
||||
);
|
||||
|
||||
const mapDispatchToProps = (dispatch: Dispatch) => ({
|
||||
minimize: () => dispatch(Actions.minimize())
|
||||
});
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
mapDispatchToProps
|
||||
)(Minimize);
|
||||
Loading…
Add table
Add a link
Reference in a new issue