import React, { PureComponent } from 'react';

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

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

