UNPKG

3.64 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = Site;
7
8var _react = require('react');
9
10var _react2 = _interopRequireDefault(_react);
11
12var _meta = require('./meta');
13
14var _meta2 = _interopRequireDefault(_meta);
15
16function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18function Site(_ref) {
19 var meta = _ref.meta;
20 var bundle = _ref.bundle;
21 var content = _ref.content;
22 var style = _ref.style;
23
24 meta = meta || _meta2.default.rewind();
25 return _react2.default.createElement(
26 'html',
27 meta.htmlAttributes.toComponent(),
28 _react2.default.createElement(
29 'head',
30 null,
31 _react2.default.createElement('meta', { charSet: 'utf8' }),
32 meta.meta.toComponent(),
33 style && _react2.default.createElement('style', { dangerouslySetInnerHTML: { __html: style } }),
34 meta.link.toComponent(),
35 bundle.css && _react2.default.createElement('link', { rel: 'stylesheet', href: bundle.css }),
36 meta.title.toComponent()
37 ),
38 _react2.default.createElement(
39 'body',
40 null,
41 _react2.default.createElement('div', { id: 'main', dangerouslySetInnerHTML: { __html: content } }),
42 _react2.default.createElement('script', { async: true, src: bundle.js })
43 )
44 );
45}
46
47Site.defaultProps = {
48 content: '',
49 bundle: {
50 js: null,
51 css: null
52 }
53};
54//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9hbmRyZXlwb3BwL1dvcmtzcGFjZS9zaXRlZ2VuL3NyYy9TaXRlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O2tCQUd3QixJOztBQUh4Qjs7OztBQUNBOzs7Ozs7QUFFZSxTQUFTLElBQVQsT0FBOEM7QUFBQSxNQUEvQixJQUErQixRQUEvQixJQUErQjtBQUFBLE1BQXpCLE1BQXlCLFFBQXpCLE1BQXlCO0FBQUEsTUFBakIsT0FBaUIsUUFBakIsT0FBaUI7QUFBQSxNQUFSLEtBQVEsUUFBUixLQUFROzt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