Html.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * React Static Boilerplate
  3. * https://github.com/koistya/react-static-boilerplate
  4. * Copyright (c) Konstantin Tarkus (@koistya) | MIT license
  5. */
  6. import React, { PropTypes } from 'react';
  7. import GoogleAnalytics from '../GoogleAnalytics';
  8. import config from '../../config';
  9. function Html({ title, description, body, debug }) {
  10. return (
  11. <html className="no-js" lang="">
  12. <head>
  13. <meta charSet="utf-8" />
  14. <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
  15. <title>{title || config.title}</title>
  16. <meta name="description" content={description || config.description} />
  17. <meta name="viewport" content="width=device-width, initial-scale=1" />
  18. <link rel="apple-touch-icon" href="apple-touch-icon.png" />
  19. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto" />
  20. <script src={'/app.js?' + new Date().getTime()} />
  21. </head>
  22. <body>
  23. <div id="app" dangerouslySetInnerHTML={{ __html: body }} />
  24. <GoogleAnalytics />
  25. </body>
  26. </html>
  27. );
  28. }
  29. Html.propTypes = {
  30. title: PropTypes.string,
  31. description: PropTypes.string,
  32. body: PropTypes.string.isRequired,
  33. debug: PropTypes.bool.isRequired,
  34. };
  35. export default Html;