diff --git a/src/components/singular-product/singular-product-styles.js b/src/components/singular-product/singular-product-styles.js index 2ad2dfb..c5c99d3 100644 --- a/src/components/singular-product/singular-product-styles.js +++ b/src/components/singular-product/singular-product-styles.js @@ -6,7 +6,6 @@ import { } from "../../style/variables" import colors from "../../style/colors" - export const SingularProductContainer = styled.div`` export const HeroSection = styled.div` diff --git a/src/pages/products.js b/src/pages/products.js index 6f7480c..1633d97 100644 --- a/src/pages/products.js +++ b/src/pages/products.js @@ -43,6 +43,13 @@ export const query = graphql` button_destination button_title cta_title + feature_icon { + url + dimensions { + height + width + } + } feature_title features { feature_name diff --git a/src/schemas/product.json b/src/schemas/product.json index 5b14b3c..75669f0 100644 --- a/src/schemas/product.json +++ b/src/schemas/product.json @@ -32,6 +32,12 @@ "label" : "Product Description" } }, + "product_recommendation" : { + "type" : "Text", + "config" : { + "label" : "Product Recommendation" + } + }, "product_images" : { "type" : "Group", "config" : { diff --git a/src/templates/product.js b/src/templates/product.js index 4d89338..a4a5d2d 100644 --- a/src/templates/product.js +++ b/src/templates/product.js @@ -1,20 +1,178 @@ -import React from "react" +import React, { useState } from "react" import { graphql } from "gatsby" +import { H1, H2, H3, Sub1, P } from "../style/type-styles" +import { + SingularProductContainer, + HeroSection, + ImageContainer, + TextContainer, + ProductType, + IconSection, + IconContainer, + Icon, + IconImage, + IconCaption, + ImageHighlightSection, + ImageHighlightHeading, + ImageHighlightGroupContainer, + ImageHighlightGroup, + HighlightedImage, + ImageHighlightDescription, + ThirdSection, + FeatureSpecSection, + FeatureIcon, + Feature, + FeatureName, + FeatureImage, + FeatureDescription, + IconHeader, +} from "../components/singular-product/singular-product-styles" +import Layout from "../components/layout" export default function Product({ data }) { const products = data.allPrismicProduct.edges[0].node + const [mainImage, setMainImage] = useState(0) - return

{products.data.product_title}

+ return ( + + + + + {products.data.product_images[mainImage].image.alt} + {products.data.product_images.map((image, id) => { + return ( + <> + setMainImage(id)} + src={image.image.url} + alt={image.alt} + key={id} + /> + + ) + })} + + + + {products.data.product_type} + +

{products.data.product_title}

+

{products.data.product_description.text}

+
+
+ + + +

{products.data.icon_section_title}

+
+ + {products.data.icons.map((icon, id) => { + return ( + + + {icon.icon_image.alt} + + +

{icon.icon_text}

+
+
+ ) + })} +
+
+ + + +

{products.data.image_highlight_heading}

+
+ + {products.data.image_highlight_group.map((highlight, id) => { + return ( + + + + {highlight.highlighted_image.alt} + + + {highlight.image_highlight_description} + + + + ) + })} + +
+ + + + {products.data.feature_icon.alt} + +

{products.data.feature_title}

+
+ {products.data.features.map((feature, id) => { + return ( + + + {feature.feature_name} + + + {feature.feature_image.alt} + + +

{feature.feature_description}

+
+
+ ) + })} +
+
+
+
+ ) } export const query = graphql` query($uid: String!) { allPrismicProduct(filter: { uid: { eq: $uid } }) { - edges { + edges { node { id uid data { + feature_icon { + url + alt + dimensions { + height + width + } + } product_title button_destination button_title @@ -22,8 +180,10 @@ export const query = graphql` feature_title features { feature_name + feature_description feature_image { url + alt } } icon_section_title @@ -31,6 +191,7 @@ export const query = graphql` icon_text icon_image { url + alt } } product_description { @@ -39,9 +200,22 @@ export const query = graphql` product_images { image { url + alt } } product_type + image_highlight_group { + highlighted_image { + dimensions { + height + width + } + url + alt + } + image_highlight_description + } + image_highlight_heading } } }