From dd55b5590ee8018b5adbfdee3a015e9853afd5c5 Mon Sep 17 00:00:00 2001 From: Cayla Hamann Date: Mon, 15 Jun 2020 14:00:58 -0400 Subject: [PATCH] WIP: fixing layout bug --- src/components/BreadcrumbBar.js | 27 ++--- src/components/Container.js | 15 --- src/components/Container.module.scss | 6 - src/components/Footer.js | 13 +- src/components/Footer.module.scss | 10 -- src/components/GuideListing/GuideListing.js | 5 +- src/components/Header.js | 81 +++++-------- src/components/Jumbotron.js | 59 +++++----- src/components/Layout.js | 11 +- src/components/Layout.module.scss | 18 +-- src/components/Sidebar.js | 2 +- src/components/Sidebar.module.scss | 3 - src/components/styles.scss | 4 + src/pages/index.js | 64 +++++----- src/templates/ApiReferenceTemplate.js | 80 ++++++------- src/templates/ComponentReferenceTemplate.js | 124 +++++++++----------- src/templates/GuideTemplate.js | 11 +- src/templates/ReferenceTemplate.module.scss | 20 ---- 18 files changed, 214 insertions(+), 339 deletions(-) delete mode 100644 src/components/Container.js delete mode 100644 src/components/Container.module.scss diff --git a/src/components/BreadcrumbBar.js b/src/components/BreadcrumbBar.js index 9b4fc01dd..65f43df95 100644 --- a/src/components/BreadcrumbBar.js +++ b/src/components/BreadcrumbBar.js @@ -1,26 +1,23 @@ import React from 'react'; import { Link } from 'gatsby'; import styles from './BreadcrumbBar.module.scss'; -import Container from './Container'; import PropTypes from 'prop-types'; import { link } from '../types'; const BreadcrumbBar = ({ crumbs, duration }) => (
- -
    - {crumbs.map((crumb, index) => ( -
  • - {crumb.url ? ( - {crumb.displayName} - ) : ( - {crumb.displayName} - )} -
  • - ))} -
- {duration &&
{duration}
} -
+ + {duration &&
{duration}
}
); diff --git a/src/components/Container.js b/src/components/Container.js deleted file mode 100644 index aee2b53d6..000000000 --- a/src/components/Container.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import cx from 'classnames'; -import styles from './Container.module.scss'; - -const Container = ({ children, className }) => ( -
{children}
-); - -Container.propTypes = { - children: PropTypes.node.isRequired, - className: PropTypes.string, -}; - -export default Container; diff --git a/src/components/Container.module.scss b/src/components/Container.module.scss deleted file mode 100644 index eb639745f..000000000 --- a/src/components/Container.module.scss +++ /dev/null @@ -1,6 +0,0 @@ -.container { - max-width: 1200px; - margin: auto; - box-sizing: border-box; - padding: 0 1rem; -} diff --git a/src/components/Footer.js b/src/components/Footer.js index 05d6d4f6e..9b13b6003 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -1,18 +1,15 @@ import React from 'react'; import { Link } from 'gatsby'; -import Container from './Container'; import styles from './Footer.module.scss'; const Footer = () => ( ); diff --git a/src/components/Footer.module.scss b/src/components/Footer.module.scss index 1267dd23c..ba2147c2c 100644 --- a/src/components/Footer.module.scss +++ b/src/components/Footer.module.scss @@ -7,16 +7,6 @@ margin-top: 10rem; } -.container { - display: flex; - justify-content: space-between; - align-items: center; - - @media (max-width: 760px) { - justify-content: center; - } -} - .leftColumn { display: flex; align-items: center; diff --git a/src/components/GuideListing/GuideListing.js b/src/components/GuideListing/GuideListing.js index ccc4e7465..e307facbc 100644 --- a/src/components/GuideListing/GuideListing.js +++ b/src/components/GuideListing/GuideListing.js @@ -1,4 +1,3 @@ -import Container from '../Container'; import Heading from './Heading'; import Description from './Description'; import List from './List'; @@ -7,9 +6,7 @@ import React from 'react'; import styles from './GuideListing.module.scss'; const GuideListing = ({ children }) => ( -
- {children} -
+
{children}
); GuideListing.Heading = Heading; diff --git a/src/components/Header.js b/src/components/Header.js index 7b3226de5..fb579a2ca 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -1,7 +1,6 @@ import React, { useState } from 'react'; import { Link } from 'gatsby'; import cx from 'classnames'; -import Container from './Container'; import ExternalLink from './ExternalLink'; import HamburgerMenu from './HamburgerMenu'; import styles from './Header.module.scss'; @@ -11,56 +10,38 @@ const Header = () => { return (
- - + - setIsOpen(!isOpen)} - isOpen={isOpen} - /> - - - + setIsOpen(!isOpen)} + isOpen={isOpen} + />
); }; diff --git a/src/components/Jumbotron.js b/src/components/Jumbotron.js index 74aa4da0c..bc133277a 100644 --- a/src/components/Jumbotron.js +++ b/src/components/Jumbotron.js @@ -1,42 +1,39 @@ import React from 'react'; import { Link } from 'gatsby'; -import Container from './Container'; import CallToAction from './CallToAction'; import styles from './Jumbotron.module.scss'; const Jumbotron = () => ( - -
-

Create a free account to get started

-
- -
- - -
- Sign in to New Relic One -
- - - Create a new API key - - - - Download for other platforms - -
+ + Sign in to New Relic One + + + + Create a new API key + + + + Download for other platforms +
-
+ ); export default Jumbotron; diff --git a/src/components/Layout.js b/src/components/Layout.js index ccfa5f6c2..0d8d861b2 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -8,14 +8,15 @@ import styles from './Layout.module.scss'; import pages from '../data/sidenav.json'; import './styles.scss'; - const Layout = ({ children }) => ( -
+ <>
- -
{children}
+
+ +
{children}
+
-
+ ); Layout.propTypes = { diff --git a/src/components/Layout.module.scss b/src/components/Layout.module.scss index 069ad3be3..6890306c2 100644 --- a/src/components/Layout.module.scss +++ b/src/components/Layout.module.scss @@ -1,19 +1,7 @@ .layout { min-height: 100vh; display: grid; - grid-template-columns: 1fr 3fr; - - > header { - grid-column-start: 1; - grid-column-end: 3; - grid-row-start: 1; - grid-row-end: 2; - } - - > footer { - grid-column-start: 1; - grid-column-end: 3; - grid-row-start: 3; - grid-row-end: 4; - } + grid-template-columns: auto 1fr; + max-width: 1200px; + margin: 0 auto; } diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index 77b938a70..6a7f507c0 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -23,7 +23,7 @@ const renderNav = (page, index) => ( const Sidebar = ({ className, pages, isOpen, toggle }) => (