Skip to content

Commit

Permalink
#31 product card link
Browse files Browse the repository at this point in the history
  • Loading branch information
samgildea committed May 7, 2021
1 parent 7a8276e commit 97eba93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/components/product_page/product-page-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export const ProductsHeading = styled.div`
color: ${colors.blue900};
`

export const ProductCard = styled.a`
color: ${colors.blue900};
text-decoration: none;
`

export const FeaturedProductImage = styled.div`
img {
width: 47vw;
Expand Down
9 changes: 5 additions & 4 deletions src/components/product_page/product-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ProductsHeading,
FeaturedCTA,
ProductCTA,
ProductCard,
} from "./product-page-styles"

export default function ProductSection({ data }) {
Expand Down Expand Up @@ -46,7 +47,7 @@ export default function ProductSection({ data }) {
{data.products.map(product => {
return (
product.product.document.data.product_type === "Homeowner" && (
<div>
<ProductCard href={`/${product.product.document.uid}`}>
<ProductImage>
<img
src={
Expand All @@ -67,7 +68,7 @@ export default function ProductSection({ data }) {
{product.button_text}
</a>
</ProductCTA>
</div>
</ProductCard>
)
)
})}
Expand All @@ -81,7 +82,7 @@ export default function ProductSection({ data }) {
{data.products.map(product => {
return (
product.product.document.data.product_type === "Commercial" && (
<div>
<ProductCard href={`/${product.product.document.uid}`}>
<ProductImage>
<img
src={
Expand All @@ -103,7 +104,7 @@ export default function ProductSection({ data }) {
{product.button_text}
</a>
</ProductCTA>
</div>
</ProductCard>
)
)
})}
Expand Down

0 comments on commit 97eba93

Please sign in to comment.