From 749427a510c5379517d8dcc0c61bbd289074388d Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Wed, 29 Jul 2020 14:09:01 -0700 Subject: [PATCH] feat: Add the related content sidebar to the main page --- src/layouts/MainLayout.js | 65 +++++++++++++++++++++++++----- src/layouts/MainLayout.module.scss | 26 ------------ 2 files changed, 56 insertions(+), 35 deletions(-) diff --git a/src/layouts/MainLayout.js b/src/layouts/MainLayout.js index 1a1ca9e76..ff4360762 100644 --- a/src/layouts/MainLayout.js +++ b/src/layouts/MainLayout.js @@ -1,6 +1,7 @@ import React, { useContext, useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; +import { css } from '@emotion/core'; import { Helmet } from 'react-helmet'; import { GlobalHeader } from '@newrelic/gatsby-theme-newrelic'; @@ -11,6 +12,7 @@ import Footer from '../components/Footer'; import MobileHeader from '../components/MobileHeader'; import Sidebar from '../components/Sidebar'; import CookieApprovalDialog from '../components/CookieApprovalDialog'; +import RelatedContent from '../components/RelatedContent'; import styles from './MainLayout.module.scss'; import '../components/styles.scss'; @@ -19,10 +21,14 @@ const gdprConsentCookieName = 'newrelic-gdpr-consent'; const MainLayout = ({ children }) => { const { - site: { siteMetadata }, + site: { layout, siteMetadata }, } = useStaticQuery(graphql` query { site { + layout { + contentPadding + maxWidth + } siteMetadata { repository } @@ -66,17 +72,58 @@ const MainLayout = ({ children }) => { isOpen={isMobileNavOpen} toggle={() => setIsMobileNavOpen(!isMobileNavOpen)} /> -
- -
+
+
+
-
{children}
-
+ {children} +
+
+
+
diff --git a/src/layouts/MainLayout.module.scss b/src/layouts/MainLayout.module.scss index 8f1743aa9..42d09bd19 100644 --- a/src/layouts/MainLayout.module.scss +++ b/src/layouts/MainLayout.module.scss @@ -7,22 +7,6 @@ grid-template-rows: auto 1fr; } -.main { - display: grid; - grid-template-columns: var(--sidebar-width) minmax(0, 1fr); - width: 100%; - - @media screen and (max-width: 760px) { - grid-template-columns: minmax(0, 1fr); - } -} - -.contentContainer { - display: flex; - flex-direction: column; - margin: 2rem; -} - .sidebar { position: fixed; top: var(--global-header-height); @@ -32,16 +16,6 @@ overflow: auto; } -.content { - flex: 1; - margin-bottom: 2rem; -} - -.footer { - border-top: 1px solid var(--divider-color); - padding-top: 2rem; -} - .hideOnDesktop { @media (min-width: 760px + 1) { display: none;