text: import React, { useState } from "react";
  import PropTypes from "prop-types";
  import { Link } from "gatsby";
  import { StaticQuery, graphql } from "gatsby";
  
  import "../styles/index.sass";
  
  const TemplateWrapper = ({ children }) => {
    const [showMenu, setShowMenu] = useState(false);
    return (
      <StaticQuery
        query={graphql`
          query LayoutQuery {
            aamu {
              Pages(title: "Home") {
                text
                copyright
              }
            }
          }
        `}
        render={data => (
          <div className={`container ${showMenu ? "is-open" : ""}`}>
            <div className="container__sidebar">
              <div className="sidebar">
                <div
                  className="sidebar__intro"
                  dangerouslySetInnerHTML={{
                    __html:
                      data.text
                  }}
                />
                <ul className="sidebar__menu">
                  <li>
                    <Link to="/">Home</Link>
                  </li>
                  <li>
                    <Link to="/about">About</Link>
                  </li>
                </ul>
                <div className="sidebar__copyright">
                  {data.copyright}
                </div>
              </div>
            </div>
            <div className="container__body">
              <div className="container__mobile-header">
                <div className="mobile-header">
                  <div className="mobile-header__menu">
                    <a
                      alt="moi"
                      href="#"
                      onClick={e => {
                        e.preventDefault();
                        setShowMenu(!showMenu);
                      }}
                    />
                  </div>
                </div>
              </div>
              {children}
            </div>
          </div>
        )}
      />
    );
  };
  
  TemplateWrapper.propTypes = {
    children: PropTypes.object
  };
  
  export default TemplateWrapper;
  