diff --git a/js/actionTypes.js b/js/actionTypes.js index 85111ce6..be4b44c9 100644 --- a/js/actionTypes.js +++ b/js/actionTypes.js @@ -70,3 +70,4 @@ export const NETWORK_CONNECTED = "NETWORK_CONNECTED"; export const NETWORK_DISCONNECTED = "NETWORK_DISCONNECTED"; export const UPDATE_WINDOW_POSITIONS = "UPDATE_WINDOW_POSITIONS"; export const CHANNEL_COUNT_CHANGED = "CHANNEL_COUNT_CHANGED"; +export const GEN_WINDOW_SIZE_CHANGED = "GEN_WINDOW_SIZE_CHANGED"; diff --git a/js/components/GenWindow/index.js b/js/components/GenWindow/index.js index 981e176e..803e67e9 100644 --- a/js/components/GenWindow/index.js +++ b/js/components/GenWindow/index.js @@ -4,7 +4,11 @@ import PropTypes from "prop-types"; import classnames from "classnames"; import "../../../css/gen-window.css"; -import { SET_FOCUSED_WINDOW, CLOSE_GEN_WINDOW } from "../../actionTypes"; +import { + SET_FOCUSED_WINDOW, + CLOSE_GEN_WINDOW, + GEN_WINDOW_SIZE_CHANGED +} from "../../actionTypes"; import { scrollVolume } from "../../actionCreators"; import { getWindowPixelSize } from "../../selectors"; import ResizeTarget from "../ResizeTarget"; @@ -25,73 +29,65 @@ const CHROME_WIDTH = 19; const CHROME_HEIGHT = 34; // Named export for testing -export class GenWindow extends React.Component { - constructor(props) { - super(props); - this.state = { windowSize: [0, 0] }; - } - render() { - const { - selected, - children, - close, - title, - setFocus, - windowId, - scrollVolume: handleWheel - } = this.props; - const { width, height } = getWindowPixelSize(this.state.windowSize); - return ( -