diff --git a/src/components/EntryEditor.css b/src/components/EntryEditor.css index 9cacb875..cb309fad 100644 --- a/src/components/EntryEditor.css +++ b/src/components/EntryEditor.css @@ -1,26 +1,27 @@ -.entryEditor { +.root { + position: absolute; + top: 64px; + bottom: 0; display: flex; flex-direction: column; - height: 100%; } .container { + flex: 1; display: flex; - height: 100%; } .footer { + flex: 0; background: #fff; height: 45px; border-top: 1px solid #e8eae8; padding: 10px 20px; - z-index: 10; } .controlPane { - width: 50%; - max-height: 100%; + flex: 1; overflow: auto; padding: 0 20px; border-right: 1px solid #e8eae8; } .previewPane { - width: 50%; + flex: 1; } diff --git a/src/components/EntryEditor.js b/src/components/EntryEditor.js index fd308698..2bd872ea 100644 --- a/src/components/EntryEditor.js +++ b/src/components/EntryEditor.js @@ -4,57 +4,35 @@ 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); - } +export default function EntryEditor(props) { + const { collection, entry, getMedia, onChange, onAddMedia, onRemoveMedia, onPersist } = props; - 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
+ return ( +
- +
-
; - } +
+ ); } EntryEditor.propTypes = { diff --git a/src/components/PreviewPane.css b/src/components/PreviewPane.css index af8c2001..6bf62a0a 100644 --- a/src/components/PreviewPane.css +++ b/src/components/PreviewPane.css @@ -1,6 +1,6 @@ .frame { width: 100%; - height: 100vh; + height: 100%; border: none; background: #fff; }