mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-04 07:55:28 +00:00
Type PlaylistResizeTarget
This commit is contained in:
parent
315fa0a4f0
commit
34b93df766
2 changed files with 32 additions and 18 deletions
|
|
@ -1,18 +0,0 @@
|
|||
import { connect } from "react-redux";
|
||||
import ResizeTarget from "../ResizeTarget";
|
||||
import { setWindowSize } from "../../actionCreators";
|
||||
import { getWindowSize } from "../../selectors";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
currentSize: getWindowSize(state)("playlist"),
|
||||
id: "playlist-resize-target"
|
||||
});
|
||||
|
||||
const mapDispatchToProps = {
|
||||
setWindowSize: size => setWindowSize("playlist", size)
|
||||
};
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ResizeTarget);
|
||||
32
js/components/PlaylistWindow/PlaylistResizeTarget.tsx
Normal file
32
js/components/PlaylistWindow/PlaylistResizeTarget.tsx
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { connect } from "react-redux";
|
||||
import ResizeTarget from "../ResizeTarget";
|
||||
import { setWindowSize } from "../../actionCreators";
|
||||
import { getWindowSize } from "../../selectors";
|
||||
import { AppState, Dispatch } from "../../types";
|
||||
|
||||
interface StateProps {
|
||||
currentSize: [number, number];
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface DispatchProps {
|
||||
currentSize: [number, number];
|
||||
id: string;
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: AppState): StateProps => ({
|
||||
currentSize: getWindowSize(state)("playlist"),
|
||||
id: "playlist-resize-target"
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch: Dispatch) => {
|
||||
return {
|
||||
setWindowSize: (size: [number, number]) =>
|
||||
dispatch(setWindowSize("playlist", size))
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ResizeTarget);
|
||||
Loading…
Add table
Add a link
Reference in a new issue