Layout.js 879 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * React Static Boilerplate
  3. * https://github.com/koistya/react-static-boilerplate
  4. *
  5. * Copyright © 2015-2016 Konstantin Tarkus (@koistya)
  6. *
  7. * This source code is licensed under the MIT license found in the
  8. * LICENSE.txt file in the root directory of this source tree.
  9. */
  10. import React from 'react';
  11. import Header from './Header';
  12. import s from './Layout.css';
  13. class Layout extends React.Component {
  14. componentDidMount() {
  15. window.componentHandler.upgradeElement(this.refs.root);
  16. }
  17. componentWillUnmount() {
  18. window.componentHandler.downgradeElements(this.refs.root);
  19. }
  20. render() {
  21. return (
  22. <div className="mdl-layout mdl-js-layout" ref="root">
  23. <div className="mdl-layout__inner-container">
  24. <Header />
  25. <main {...this.props} className={s.content} />
  26. </div>
  27. </div>
  28. );
  29. }
  30. }
  31. export default Layout;