diff --git a/src/components/GuideListing.js b/src/components/GuideListing.js new file mode 100644 index 000000000..01f9bc224 --- /dev/null +++ b/src/components/GuideListing.js @@ -0,0 +1,25 @@ +import './GuideListing.scss'; + +import GuideTile from './GuideTile'; +import PropTypes from 'prop-types'; +import React from 'react'; + +const GuideListing = ({ heading, description, guides }) => ( +
+

{heading}

+

{description}

+
+ {guides.map((guide, index) => ( + + ))} +
+
+); + +GuideListing.propTypes = { + heading: PropTypes.string.isRequired, + description: PropTypes.string.isRequired, + guides: PropTypes.object.isRequired, +}; + +export default GuideListing; diff --git a/src/components/GuideListing.scss b/src/components/GuideListing.scss new file mode 100644 index 000000000..c71989196 --- /dev/null +++ b/src/components/GuideListing.scss @@ -0,0 +1,22 @@ +.GuideListing { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 2.5rem; +} + +.GuideListing-heading, +.GuideListing-description { + max-width: 800px; + text-align: center; + margin-bottom: 1.5rem; +} + +.GuideListing-list { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); + grid-gap: 1rem; + grid-auto-rows: minmax(248px, auto); + margin-top: 1rem; + width: 100%; +} diff --git a/src/components/GuidePage.js b/src/components/GuidePage.js deleted file mode 100644 index 057bd8de4..000000000 --- a/src/components/GuidePage.js +++ /dev/null @@ -1,23 +0,0 @@ -import GuideTile from './GuideTile'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const GuidePage = ({ heading, description, guides }) => ( - <> -

{heading}

-

{description}

-
- {guides.map((guide, index) => ( - - ))} -
- -); - -GuidePage.propTypes = { - heading: PropTypes.string.isRequired, - description: PropTypes.string.isRequired, - guides: PropTypes.object.isRequired, -}; - -export default GuidePage; diff --git a/src/components/GuideTile.js b/src/components/GuideTile.js index 6d7f01ae7..f17c01c2b 100644 --- a/src/components/GuideTile.js +++ b/src/components/GuideTile.js @@ -1,21 +1,24 @@ +import './GuideTile.scss'; + import PropTypes from 'prop-types'; import React from 'react'; - -// TODO clock icon -// TODO semantic element for root element here? -// TODO use path +import { navigate } from 'gatsby'; const GuideTile = ({ minutes, title, description, path }) => ( -
- {Number.isInteger(minutes) &&
{`${minutes} minutes`}
} -

{title}

-

{description}

- +
+
{`${minutes} minutes`}
+
+

{title}

+

{description}

+ +
); GuideTile.propTypes = { - minutes: PropTypes.number, + minutes: PropTypes.number.isRequired, title: PropTypes.string.isRequired, description: PropTypes.string.isRequired, path: PropTypes.string.isRequired, diff --git a/src/components/GuideTile.scss b/src/components/GuideTile.scss new file mode 100644 index 000000000..7f646f2df --- /dev/null +++ b/src/components/GuideTile.scss @@ -0,0 +1,30 @@ +.GuideTile { + display: grid; + grid-template-areas: + '. . time' + 'main main main'; + + background-color: var(--tile-bg-color); + padding: 1rem; +} + +.GuideTile-timeEstimate { + grid-area: time; + text-align: right; +} + +.GuideTile-main { + grid-area: main; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + width: 100%; + + margin-bottom: 1rem; +} + +.GuideTile-description { + margin-bottom: 1.5rem; + max-width: calc(100% - 4rem); +} diff --git a/src/components/styles.scss b/src/components/styles.scss index 794b6a6ab..5780106c5 100644 --- a/src/components/styles.scss +++ b/src/components/styles.scss @@ -5,6 +5,9 @@ :root { --color-black: #000; --color-white: #fff; + --tile-bg-color: rgb(215, 210, 233); + --body-max-width: 960px; + --guide-listing-columns: 2; } /*-- Reset --*/ diff --git a/src/pages/explore-data.js b/src/pages/explore-data.js index 14bf2de5d..a83ad58f3 100644 --- a/src/pages/explore-data.js +++ b/src/pages/explore-data.js @@ -1,10 +1,9 @@ -import GuidePage from '../components/GuidePage'; +import GuideListing from '../components/GuideListing'; import Layout from '../components/Layout'; import { Link } from 'gatsby'; import React from 'react'; import SEO from '../components/Seo'; -// TODO: Pull this data from a different file const heading = 'Explore Data in New Relic'; const description = `Once New Relic has your data, the next step is to query that data to get @@ -31,7 +30,7 @@ const guides = [ const ExploreDataPage = () => ( - + Go back to the homepage );