import Document, {Head, Main, NextScript} from 'next/document';
// import {ServerStyleSheet} from 'styled-components';

export default class MyDocument extends Document {
  static async getInitialProps(ctx) {
    // const sheet = new ServerStyleSheet();

    // const transform = App => {
    //   return props => sheet.collectStyles(<App />);      
    // };

    // const page = ctx.renderPage(transform);
    const initialProps = await Document.getInitialProps(ctx);
    return {
      ...initialProps,
      // ...page,
      // styleTag: sheet.getStyleElement()
    };
  }

  render() {
    return (
      <html>
        <Head>
          <style>{`
            body {
              margin: 0;
              box-sizing: border-box;
              height: calc(100vh - 79px);
              width: 100vw;
              overflow: hidden;
              font-family: Menlo;
            }
          `}</style>
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </html>
    );
  }
}
