import React, { PureComponent } from 'react';

export default function (WrappedComponent) {
    return class extends PureComponent {
        componentDidMount() {
            const height = window.innerHeight
            document.body.style.height = `${height}px`
            document.getElementById('root').style.height = `${height}px`
        }
        componentWillUnmount() {
            document.body.style.height = `auto`
            document.getElementById('root').style.height = `auto`
        }

        render() {
            return (
                <WrappedComponent {...this.props}/>
            );
        }
    }
}

