Files
freeCodeCamp/client/src/html.js

47 lines
1.3 KiB
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
export default class HTML extends React.Component {
render() {
return (
<html
className='night'
id='__fcc-html'
{...this.props.htmlAttributes}
lang='en'
>
<head>
<meta charSet='utf-8' />
<meta content='ie=edge' httpEquiv='x-ua-compatible' />
<meta
content='width=device-width, initial-scale=1.0, shrink-to-fit=no'
name='viewport'
/>
<link as='style' href='/css/bootstrap.min.css' rel='preload' />
<link href='/css/bootstrap.min.css' rel='stylesheet' />
{this.props.headComponents}
</head>
<body {...this.props.bodyAttributes}>
{this.props.preBodyComponents}
<div
2018-10-20 19:44:42 +09:00
className='tex2jax_ignore'
dangerouslySetInnerHTML={{ __html: this.props.body }}
id='___gatsby'
key={'body'}
/>
{this.props.postBodyComponents}
</body>
</html>
);
}
}
HTML.propTypes = {
body: PropTypes.string,
bodyAttributes: PropTypes.object,
headComponents: PropTypes.array,
htmlAttributes: PropTypes.object,
postBodyComponents: PropTypes.array,
preBodyComponents: PropTypes.array
};