diff --git a/src/components/ImageGallery/ImageGallery.js b/src/components/ImageGallery/ImageGallery.js new file mode 100644 index 000000000..269d686c6 --- /dev/null +++ b/src/components/ImageGallery/ImageGallery.js @@ -0,0 +1,79 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { css } from '@emotion/react'; + +// TODO: replace with import of image, rather than grabbing one off the web +const noImagePlaceholder = + 'https://socialistmodernism.com/wp-content/uploads/2017/07/placeholder-image.png'; + +const CreateImageBlock = (image) => { + return ( + + placeholder-text + + ); +}; + +/** + * @param {Object} props + * @param {String[]} props.images - Array of images urls. + * @param {String} props.className + */ +const ImageGallery = ({ images, className }) => { + return ( +
+ {images && images.length > 0 + ? images.map((image) => { + return CreateImageBlock(image); + }) + : CreateImageBlock(noImagePlaceholder)} +
+ ); +}; + +ImageGallery.propTypes = { + images: PropTypes.arrayOf(PropTypes.string), + className: PropTypes.string, +}; + +export default ImageGallery; diff --git a/src/components/ImageGallery/index.js b/src/components/ImageGallery/index.js new file mode 100644 index 000000000..db657797b --- /dev/null +++ b/src/components/ImageGallery/index.js @@ -0,0 +1 @@ +export { default } from './ImageGallery'; diff --git a/src/templates/ObservabilityPackDetails.js b/src/templates/ObservabilityPackDetails.js index 3092feb21..863991c9e 100644 --- a/src/templates/ObservabilityPackDetails.js +++ b/src/templates/ObservabilityPackDetails.js @@ -5,8 +5,8 @@ import DevSiteSeo from '../components/DevSiteSeo'; import PropTypes from 'prop-types'; import PageLayout from '../components/PageLayout'; import Tabs from '../components/Tabs'; -import noImagePlaceholder from '../images/no-image-placeholder.png'; import { Layout, PageTools, Button } from '@newrelic/gatsby-theme-newrelic'; +import ImageGallery from '../components/ImageGallery'; const ObservabilityPackDetails = ({ data, location }) => { const pack = data.observabilityPacks; @@ -74,11 +74,7 @@ const ObservabilityPackDetails = ({ data, location }) => { {/* carousel component if we decide to use multiple images */} - placeholder +

Description

{pack.description}

@@ -86,17 +82,7 @@ const ObservabilityPackDetails = ({ data, location }) => { {pack.dashboards?.map((dashboard) => ( <>

{dashboard.name}

- {dashboard.screenshots?.map((screenshot, index) => ( - dashboard example - ))} + {dashboard.description && ( <>

Description