import React, { PropTypes } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ControlPane from './ControlPane'; import PreviewPane from './PreviewPane'; import styles from './EntryEditor.css'; export default class EntryEditor extends React.Component { constructor(props) { super(props); this.state = {}; this.handleResize = this.handleResize.bind(this); } componentDidMount() { this.calculateHeight(); window.addEventListener('resize', this.handleResize, false); } componengWillUnmount() { window.removeEventListener('resize', this.handleResize); } handleResize() { this.calculateHeight(); } calculateHeight() { const height = window.innerHeight - 54; console.log('setting height to %s', height); this.setState({ height }); } render() { const { collection, entry, getMedia, onChange, onAddMedia, onRemoveMedia, onPersist } = this.props; const { height } = this.state; return
; } } EntryEditor.propTypes = { collection: ImmutablePropTypes.map.isRequired, entry: ImmutablePropTypes.map.isRequired, getMedia: PropTypes.func.isRequired, onAddMedia: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired, onPersist: PropTypes.func.isRequired, onRemoveMedia: PropTypes.func.isRequired, };