import React from "react"; import { connect } from "react-redux"; import PropTypes from "prop-types"; import classnames from "classnames"; import "../../../css/gen-window.css"; import { SET_FOCUSED_WINDOW, CLOSE_GEN_WINDOW } from "../../actionTypes"; import { scrollVolume } from "../../actionCreators"; import { getWindowPixelSize } from "../../selectors"; import ResizeTarget from "../ResizeTarget"; const Text = ({ children }) => { const letters = children.split(""); return letters.map((letter, i) => (
)); }; 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 (