-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-templates-lesson-jsx-ff14081843f7192fde06.js.map
1 lines (1 loc) · 30.3 KB
/
component---src-templates-lesson-jsx-ff14081843f7192fde06.js.map
1
{"version":3,"sources":["webpack:///component---src-templates-lesson-jsx-ff14081843f7192fde06.js","webpack:///./src/components/Layout/TableOfContents.jsx","webpack:///./src/templates/lesson.jsx"],"names":["webpackJsonp","222","module","exports","__webpack_require__","_interopRequireDefault","obj","__esModule","default","_taggedTemplateLiteralLoose","strings","raw","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","_templateObject","_templateObject2","_templateObject3","_templateObject4","_react","_react2","_gatsbyLink","_gatsbyLink2","_styledComponents","_styledComponents2","TableOfContents","_React$Component","this","_this","nodeListItemsToRender","currentLevel","formatChapterTitle","title","split","map","word","toUpperCase","substring","join","addSubchapterJSX","node","push","createElement","SubchapterLIContainer","key","addChapterJSX","ChapterLIContainer","buildLessonItemNodes","nodeArray","_this2","forEach","LessonLIContainer","post","id","to","childMarkdownRemark","fields","slug","frontmatter","buildChapterNodes","buildNodes","nodes","getNextNode","postNodes","keys","nextIndex","indexOf","_this3","nextNode","Array","isArray","undefined","render","posts","props","chapters","TableOfContentsContainer","Component","div","theme","sitePadding","li","brand","231","pageQuery","_reactHelmet","_reactHelmet2","_SEO","_SEO2","_Header","_Header2","_SiteConfig","_SiteConfig2","_TableOfContents","_TableOfContents2","LessonTemplate","apply","arguments","pathContext","postNode","data","postBySlug","category_id","postDefaultCategoryID","siteTitle","postPath","postSEO","BodyGrid","HeaderContainer","location","ToCContainer","tableOfContents","BodyContainer","dangerouslySetInnerHTML","__html","html","contentWidthLaptop","accentDark","lightGrey"],"mappings":"AAAAA,cAAc,iBAERC,IACA,SAAUC,EAAQC,EAASC,GAEhC,YAqBA,SAASC,GAAuBC,GAAO,MAAOA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function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _templateObject = _taggedTemplateLiteralLoose(['\\n padding: ', ';\\n\\n & > ul {\\n list-style: none;\\n padding: 0;\\n margin: 0;\\n }\\n \\n'], ['\\n padding: ', ';\\n\\n & > ul {\\n list-style: none;\\n padding: 0;\\n margin: 0;\\n }\\n \\n']),\n\t _templateObject2 = _taggedTemplateLiteralLoose(['\\n\\n li {\\n margin: 0;\\n h6, p {\\n display: inline-block;\\n font-weight: 200;\\n color: black;\\n margin: 0;\\n line-height: 1.5;\\n border-bottom: 1px solid transparent;\\n }\\n }\\n &:hover {\\n li {\\n h6 {\\n border-bottom: 1px solid black;\\n }\\n }\\n }\\n'], ['\\n\\n li {\\n margin: 0;\\n h6, p {\\n display: inline-block;\\n font-weight: 200;\\n color: black;\\n margin: 0;\\n line-height: 1.5;\\n border-bottom: 1px solid transparent;\\n }\\n }\\n &:hover {\\n li {\\n h6 {\\n border-bottom: 1px solid black;\\n }\\n }\\n }\\n']),\n\t _templateObject3 = _taggedTemplateLiteralLoose(['\\n h5 {\\n font-weight: 200;\\n font-size: 2.8rem;\\n color: ', ';\\n margin-bottom: 10px;\\n }\\n\\n'], ['\\n h5 {\\n font-weight: 200;\\n font-size: 2.8rem;\\n color: ', ';\\n margin-bottom: 10px;\\n }\\n\\n']),\n\t _templateObject4 = _taggedTemplateLiteralLoose(['\\n h5 {\\n font-weight: 600;\\n color: black;\\n margin-bottom: 5px;\\n }\\n'], ['\\n h5 {\\n font-weight: 600;\\n color: black;\\n margin-bottom: 5px;\\n }\\n']);\n\t\n\tvar _react = __webpack_require__(1);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _gatsbyLink = __webpack_require__(29);\n\t\n\tvar _gatsbyLink2 = _interopRequireDefault(_gatsbyLink);\n\t\n\tvar _styledComponents = __webpack_require__(18);\n\t\n\tvar _styledComponents2 = _interopRequireDefault(_styledComponents);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TableOfContents = function (_React$Component) {\n\t _inherits(TableOfContents, _React$Component);\n\t\n\t function TableOfContents() {\n\t _classCallCheck(this, TableOfContents);\n\t\n\t var _this = _possibleConstructorReturn(this, _React$Component.call(this));\n\t\n\t _this.nodeListItemsToRender = [];\n\t _this.currentLevel = 0;\n\t return _this;\n\t }\n\t\n\t TableOfContents.prototype.formatChapterTitle = function formatChapterTitle(title) {\n\t return title.split('_').map(function (word) {\n\t return word[0].toUpperCase() + word.substring(1);\n\t }).join(' ');\n\t };\n\t\n\t TableOfContents.prototype.addSubchapterJSX = function addSubchapterJSX(node) {\n\t this.nodeListItemsToRender.push(_react2.default.createElement(\n\t SubchapterLIContainer,\n\t { key: node },\n\t _react2.default.createElement(\n\t 'h5',\n\t null,\n\t this.formatChapterTitle(node)\n\t )\n\t ));\n\t };\n\t\n\t TableOfContents.prototype.addChapterJSX = function addChapterJSX(node) {\n\t this.nodeListItemsToRender.push(_react2.default.createElement(\n\t ChapterLIContainer,\n\t { key: node },\n\t _react2.default.createElement(\n\t 'h5',\n\t null,\n\t this.formatChapterTitle(node)\n\t )\n\t ));\n\t };\n\t\n\t TableOfContents.prototype.buildLessonItemNodes = function buildLessonItemNodes(nodeArray) {\n\t var _this2 = this;\n\t\n\t nodeArray.forEach(function (node) {\n\t _this2.nodeListItemsToRender.push(_react2.default.createElement(\n\t LessonLIContainer,\n\t { key: node.post.id },\n\t _react2.default.createElement(\n\t _gatsbyLink2.default,\n\t { to: node.post.childMarkdownRemark.fields.slug },\n\t _react2.default.createElement(\n\t 'li',\n\t null,\n\t _react2.default.createElement(\n\t 'h6',\n\t null,\n\t node.post.childMarkdownRemark.frontmatter.title\n\t )\n\t )\n\t )\n\t ));\n\t });\n\t };\n\t\n\t TableOfContents.prototype.buildChapterNodes = function buildChapterNodes(node) {\n\t // If this is a Chapter (and not a subchapter)\n\t if (this.currentLevel === 0) {\n\t this.addChapterJSX(node);\n\t // Else it's a SubChapter\n\t } else {\n\t this.addSubchapterJSX(node);\n\t }\n\t };\n\t\n\t // Level matters because sub-chapter <li> and chapter <li>s are styled differently\n\t //\n\t // If the node is an Array, it holds the actual page nodes itself,\n\t // 1. Add the node's value as either a chapter <li> or subchapter <li> - based on level\n\t // 2. Build the lesson <li> links\n\t //\n\t // Else, its an object, so it must be a chapter or sub-chapter\n\t // 1. build the Chapter <li>\n\t // 2. Recursively restart on the child node\n\t //\n\t // For level, if we've hit an array, then we must be as deeply nested as possible.\n\t // So the next node we hit will be a top level chapter node, so we're back to level 0.\n\t //\n\t\n\t\n\t TableOfContents.prototype.buildNodes = function buildNodes(nodes) {\n\t var _this3 = this;\n\t\n\t function getNextNode(postNodes, node) {\n\t var keys = Object.keys(nodes);\n\t var nextIndex = keys.indexOf(node) + 1;\n\t return keys[nextIndex];\n\t }\n\t\n\t Object.keys(nodes).forEach(function (node) {\n\t var nextNode = getNextNode(nodes, node);\n\t if (Array.isArray(nodes[node])) {\n\t // Add the Lowest Level Chapter Name (Title of Array):\n\t _this3.buildChapterNodes(node);\n\t _this3.buildLessonItemNodes(nodes[node]);\n\t if (nextNode === undefined) {\n\t _this3.currentLevel -= 1;\n\t }\n\t } else {\n\t _this3.buildChapterNodes(node);\n\t _this3.currentLevel += 1;\n\t _this3.buildNodes(nodes[node]);\n\t }\n\t });\n\t };\n\t\n\t TableOfContents.prototype.render = function render() {\n\t var posts = this.props.posts.chapters;\n\t this.nodeListItemsToRender = [];\n\t this.buildNodes(posts);\n\t return _react2.default.createElement(\n\t TableOfContentsContainer,\n\t null,\n\t _react2.default.createElement(\n\t 'ul',\n\t null,\n\t this.nodeListItemsToRender\n\t )\n\t );\n\t };\n\t\n\t return TableOfContents;\n\t}(_react2.default.Component);\n\t\n\tvar TableOfContentsContainer = _styledComponents2.default.div(_templateObject, function (props) {\n\t return props.theme.sitePadding;\n\t});\n\t\n\tvar LessonLIContainer = _styledComponents2.default.div(_templateObject2);\n\t\n\tvar ChapterLIContainer = _styledComponents2.default.li(_templateObject3, function (props) {\n\t return props.theme.brand;\n\t});\n\t\n\tvar SubchapterLIContainer = _styledComponents2.default.li(_templateObject4);\n\t\n\texports.default = TableOfContents;\n\tmodule.exports = exports['default'];\n\n/***/ }),\n\n/***/ 231:\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\texports.pageQuery = undefined;\n\t\n\tvar _templateObject = _taggedTemplateLiteralLoose([\"\\n height: 100vh;\\n display: grid;\\n grid-template-rows: 75px 1fr;\\n grid-template-columns: 300px 1fr;\\n \\n @media screen and (max-width: 600px) {\\n display: flex;\\n flex-direction: column;\\n height: inherit;\\n }\\n\"], [\"\\n height: 100vh;\\n display: grid;\\n grid-template-rows: 75px 1fr;\\n grid-template-columns: 300px 1fr;\\n \\n @media screen and (max-width: 600px) {\\n display: flex;\\n flex-direction: column;\\n height: inherit;\\n }\\n\"]),\n\t _templateObject2 = _taggedTemplateLiteralLoose([\"\\n grid-column: 2 / 3;\\n grid-row: 2 / 3;\\n overflow: scroll;\\n justify-self: center;\\n width: 100%;\\n padding: \", \";\\n @media screen and (max-width: 600px) {\\n order: 2;\\n }\\n \\n & > div {\\n max-width: \", \";\\n margin: auto;\\n }\\n \\n & > h1 {\\n color: \", \";\\n }\\n\"], [\"\\n grid-column: 2 / 3;\\n grid-row: 2 / 3;\\n overflow: scroll;\\n justify-self: center;\\n width: 100%;\\n padding: \", \";\\n @media screen and (max-width: 600px) {\\n order: 2;\\n }\\n \\n & > div {\\n max-width: \", \";\\n margin: auto;\\n }\\n \\n & > h1 {\\n color: \", \";\\n }\\n\"]),\n\t _templateObject3 = _taggedTemplateLiteralLoose([\"\\n grid-column: 1 / 3;\\n grid-row: 1 / 2;\\n z-index: 2;\\n @media screen and (max-width: 600px) {\\n order: 1;\\n }\\n\"], [\"\\n grid-column: 1 / 3;\\n grid-row: 1 / 2;\\n z-index: 2;\\n @media screen and (max-width: 600px) {\\n order: 1;\\n }\\n\"]),\n\t _templateObject4 = _taggedTemplateLiteralLoose([\"\\n grid-column: 1 / 2;\\n grid-row: 2 / 3;\\n background: \", \";\\n overflow: scroll;\\n @media screen and (max-width: 600px) {\\n order: 3;\\n overflow: inherit;\\n }\\n\"], [\"\\n grid-column: 1 / 2;\\n grid-row: 2 / 3;\\n background: \", \";\\n overflow: scroll;\\n @media screen and (max-width: 600px) {\\n order: 3;\\n overflow: inherit;\\n }\\n\"]);\n\t\n\tvar _react = __webpack_require__(1);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactHelmet = __webpack_require__(31);\n\t\n\tvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\t\n\tvar _styledComponents = __webpack_require__(18);\n\t\n\tvar _styledComponents2 = _interopRequireDefault(_styledComponents);\n\t\n\tvar _gatsbyLink = __webpack_require__(29);\n\t\n\tvar _gatsbyLink2 = _interopRequireDefault(_gatsbyLink);\n\t\n\tvar _SEO = __webpack_require__(63);\n\t\n\tvar _SEO2 = _interopRequireDefault(_SEO);\n\t\n\tvar _Header = __webpack_require__(62);\n\t\n\tvar _Header2 = _interopRequireDefault(_Header);\n\t\n\tvar _SiteConfig = __webpack_require__(26);\n\t\n\tvar _SiteConfig2 = _interopRequireDefault(_SiteConfig);\n\t\n\tvar _TableOfContents = __webpack_require__(222);\n\t\n\tvar _TableOfContents2 = _interopRequireDefault(_TableOfContents);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar LessonTemplate = function (_React$Component) {\n\t _inherits(LessonTemplate, _React$Component);\n\t\n\t function LessonTemplate() {\n\t _classCallCheck(this, LessonTemplate);\n\t\n\t return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n\t }\n\t\n\t LessonTemplate.prototype.render = function render() {\n\t var slug = this.props.pathContext.slug;\n\t\n\t var postNode = this.props.data.postBySlug;\n\t var post = postNode.frontmatter;\n\t if (!post.id) {\n\t post.id = slug;\n\t }\n\t if (!post.id) {\n\t post.category_id = _SiteConfig2.default.postDefaultCategoryID;\n\t }\n\t return _react2.default.createElement(\n\t \"div\",\n\t null,\n\t _react2.default.createElement(\n\t _reactHelmet2.default,\n\t null,\n\t _react2.default.createElement(\n\t \"title\",\n\t null,\n\t post.title + \" | \" + _SiteConfig2.default.siteTitle\n\t )\n\t ),\n\t _react2.default.createElement(_SEO2.default, { postPath: slug, postNode: postNode, postSEO: true }),\n\t _react2.default.createElement(\n\t BodyGrid,\n\t null,\n\t _react2.default.createElement(\n\t HeaderContainer,\n\t null,\n\t _react2.default.createElement(_Header2.default, { location: this.props.location })\n\t ),\n\t _react2.default.createElement(\n\t ToCContainer,\n\t null,\n\t _react2.default.createElement(_TableOfContents2.default, {\n\t posts: this.props.data.tableOfContents\n\t })\n\t ),\n\t _react2.default.createElement(\n\t BodyContainer,\n\t null,\n\t _react2.default.createElement(\n\t \"div\",\n\t null,\n\t _react2.default.createElement(\n\t \"h1\",\n\t null,\n\t post.title\n\t ),\n\t _react2.default.createElement(\"div\", { dangerouslySetInnerHTML: { __html: postNode.html } })\n\t )\n\t )\n\t )\n\t );\n\t };\n\t\n\t return LessonTemplate;\n\t}(_react2.default.Component);\n\t\n\texports.default = LessonTemplate;\n\t\n\t\n\tvar BodyGrid = _styledComponents2.default.div(_templateObject);\n\t\n\tvar BodyContainer = _styledComponents2.default.div(_templateObject2, function (props) {\n\t return props.theme.sitePadding;\n\t}, function (props) {\n\t return props.theme.contentWidthLaptop;\n\t}, function (props) {\n\t return props.theme.accentDark;\n\t});\n\t\n\tvar HeaderContainer = _styledComponents2.default.div(_templateObject3);\n\t\n\tvar ToCContainer = _styledComponents2.default.div(_templateObject4, function (props) {\n\t return props.theme.lightGrey;\n\t});\n\t\n\t/* eslint no-undef: \"off\"*/\n\tvar pageQuery = exports.pageQuery = \"** extracted graphql fragment **\";\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// component---src-templates-lesson-jsx-ff14081843f7192fde06.js","import React from \"react\"\nimport Link from 'gatsby-link'\nimport styled from 'styled-components'\n\n\nclass TableOfContents extends React.Component {\n constructor() {\n super();\n this.nodeListItemsToRender = [];\n this.currentLevel = 0;\n }\n\n formatChapterTitle(title) {\n return title.split('_').map(word => word[0].toUpperCase() + word.substring(1)).join(' ');\n }\n\n addSubchapterJSX(node) {\n this.nodeListItemsToRender.push(\n <SubchapterLIContainer key={node}>\n <h5>\n {this.formatChapterTitle(node)}\n </h5>\n </SubchapterLIContainer>\n );\n }\n\n addChapterJSX(node) {\n this.nodeListItemsToRender.push(\n <ChapterLIContainer key={node}>\n <h5>\n {this.formatChapterTitle(node)}\n </h5>\n </ChapterLIContainer>\n )\n }\n\n buildLessonItemNodes(nodeArray) {\n nodeArray.forEach(node => {\n this.nodeListItemsToRender.push(\n <LessonLIContainer key={node.post.id}>\n <Link to={node.post.childMarkdownRemark.fields.slug}>\n <li>\n <h6>{node.post.childMarkdownRemark.frontmatter.title}</h6>\n </li>\n </Link>\n </LessonLIContainer>\n )\n })\n }\n\n buildChapterNodes(node) {\n // If this is a Chapter (and not a subchapter)\n if (this.currentLevel === 0) {\n this.addChapterJSX(node);\n // Else it's a SubChapter\n } else {\n this.addSubchapterJSX(node);\n }\n }\n\n\n // Level matters because sub-chapter <li> and chapter <li>s are styled differently\n //\n // If the node is an Array, it holds the actual page nodes itself,\n // 1. Add the node's value as either a chapter <li> or subchapter <li> - based on level\n // 2. Build the lesson <li> links\n //\n // Else, its an object, so it must be a chapter or sub-chapter\n // 1. build the Chapter <li>\n // 2. Recursively restart on the child node\n //\n // For level, if we've hit an array, then we must be as deeply nested as possible.\n // So the next node we hit will be a top level chapter node, so we're back to level 0.\n //\n buildNodes(nodes) {\n function getNextNode(postNodes, node) {\n const keys = Object.keys(nodes);\n const nextIndex = keys.indexOf(node) +1;\n return keys[nextIndex];\n }\n\n Object.keys(nodes).forEach(node => {\n const nextNode = getNextNode(nodes, node);\n if (Array.isArray(nodes[node])) {\n // Add the Lowest Level Chapter Name (Title of Array):\n this.buildChapterNodes(node);\n this.buildLessonItemNodes(nodes[node]);\n if (nextNode === undefined) {\n this.currentLevel -= 1;\n }\n } else {\n this.buildChapterNodes(node)\n this.currentLevel += 1;\n this.buildNodes(nodes[node])\n }\n });\n }\n\n render() {\n const posts = this.props.posts.chapters;\n this.nodeListItemsToRender = [];\n this.buildNodes(posts);\n return (\n <TableOfContentsContainer>\n <ul>\n {this.nodeListItemsToRender}\n </ul>\n </TableOfContentsContainer>\n )\n }\n}\n\nconst TableOfContentsContainer = styled.div`\n padding: ${props => props.theme.sitePadding};\n\n & > ul {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n \n`\n\nconst LessonLIContainer = styled.div`\n\n li {\n margin: 0;\n h6, p {\n display: inline-block;\n font-weight: 200;\n color: black;\n margin: 0;\n line-height: 1.5;\n border-bottom: 1px solid transparent;\n }\n }\n &:hover {\n li {\n h6 {\n border-bottom: 1px solid black;\n }\n }\n }\n`\n\nconst ChapterLIContainer = styled.li`\n h5 {\n font-weight: 200;\n font-size: 2.8rem;\n color: ${props => props.theme.brand};\n margin-bottom: 10px;\n }\n\n`\n\nconst SubchapterLIContainer = styled.li`\n h5 {\n font-weight: 600;\n color: black;\n margin-bottom: 5px;\n }\n`\n\nexport default TableOfContents\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/Layout/TableOfContents.jsx","import React from \"react\"\nimport Helmet from \"react-helmet\"\nimport styled from \"styled-components\"\nimport Link from 'gatsby-link'\n\nimport SEO from \"../components/SEO\"\nimport SiteHeader from '../components/Layout/Header'\nimport config from \"../../data/SiteConfig\"\nimport TableOfContents from \"../components/Layout/TableOfContents\"\n\nexport default class LessonTemplate extends React.Component {\n render() {\n const {slug} = this.props.pathContext\n const postNode = this.props.data.postBySlug\n const post = postNode.frontmatter\n if (!post.id) {\n post.id = slug;\n }\n if (!post.id) {\n post.category_id = config.postDefaultCategoryID;\n }\n return (\n <div>\n <Helmet>\n <title>{`${post.title} | ${config.siteTitle}`}</title>\n </Helmet>\n <SEO postPath={slug} postNode={postNode} postSEO/>\n <BodyGrid>\n <HeaderContainer>\n <SiteHeader location={this.props.location}/>\n </HeaderContainer>\n <ToCContainer>\n <TableOfContents\n posts={this.props.data.tableOfContents}\n />\n </ToCContainer>\n <BodyContainer>\n <div>\n <h1>\n {post.title}\n </h1>\n <div dangerouslySetInnerHTML={{__html: postNode.html}}/>\n </div>\n </BodyContainer>\n </BodyGrid>\n </div>\n );\n }\n}\n\nconst BodyGrid = styled.div`\n height: 100vh;\n display: grid;\n grid-template-rows: 75px 1fr;\n grid-template-columns: 300px 1fr;\n \n @media screen and (max-width: 600px) {\n display: flex;\n flex-direction: column;\n height: inherit;\n }\n`\n\nconst BodyContainer = styled.div`\n grid-column: 2 / 3;\n grid-row: 2 / 3;\n overflow: scroll;\n justify-self: center;\n width: 100%;\n padding: ${props => props.theme.sitePadding};\n @media screen and (max-width: 600px) {\n order: 2;\n }\n \n & > div {\n max-width: ${props => props.theme.contentWidthLaptop};\n margin: auto;\n }\n \n & > h1 {\n color: ${props => props.theme.accentDark};\n }\n`\n\nconst HeaderContainer = styled.div`\n grid-column: 1 / 3;\n grid-row: 1 / 2;\n z-index: 2;\n @media screen and (max-width: 600px) {\n order: 1;\n }\n`\n\nconst ToCContainer = styled.div`\n grid-column: 1 / 2;\n grid-row: 2 / 3;\n background: ${props => props.theme.lightGrey};\n overflow: scroll;\n @media screen and (max-width: 600px) {\n order: 3;\n overflow: inherit;\n }\n`\n\n/* eslint no-undef: \"off\"*/\nexport const pageQuery = graphql`\n query LessonBySlug($slug: String!) {\n postBySlug: markdownRemark(fields: { slug: { eq: $slug } }) {\n html\n timeToRead\n excerpt\n frontmatter {\n title\n cover\n date\n category\n tags\n }\n }\n tableOfContents: lessonsJson {\n coolness\n chapters {\n one {\n subchapter_one_one {\n post {\n id\n childMarkdownRemark {\n fields {\n slug\n }\n frontmatter {\n title\n }\n }\n }\n }\n subchapter_one_two {\n post {\n id\n childMarkdownRemark {\n fields {\n slug\n }\n frontmatter {\n title\n }\n }\n }\n }\n }\n two {\n subchapter_two_one {\n post {\n id\n childMarkdownRemark {\n fields {\n slug\n }\n frontmatter {\n title\n }\n }\n }\n }\n }\n three {\n post {\n id\n childMarkdownRemark {\n fields {\n slug\n }\n frontmatter {\n title\n }\n }\n }\n }\n }\n }\n }\n`;\n\n\n\n// WEBPACK FOOTER //\n// ./src/templates/lesson.jsx"],"sourceRoot":""}