Skip to content

Commit

Permalink
Added related products
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtweedy committed Feb 10, 2021
1 parent ef92886 commit 48e60d7
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/components/product/listing/ProductListing.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IonCard, IonCol, IonGrid, IonRow } from "@ionic/react";
import ProductCard from "../product-card/ProductCard";
import ProductDescription from "./description/ProductDescription";
import "./ProductListing.css";

Expand Down Expand Up @@ -33,7 +34,7 @@ const ProductListing: React.FC<ProductListingProps> = ({ product }) => {
);
})}
</IonRow>
<IonRow className="meta">
<IonRow className="meta ion-hide-md-down">
{(meta.attributes || []).map((fileName) => {
return (
<IonCol
Expand All @@ -57,6 +58,31 @@ const ProductListing: React.FC<ProductListingProps> = ({ product }) => {
<ProductDescription product={product} />
</IonCol>
</IonRow>
<IonRow>
<IonCol>
<IonGrid>
<IonRow>
<h3>Some other things you might like</h3>
</IonRow>
<IonRow>
{related_products.map((related_product) => {
return (
<IonCol
size="12"
sizeSm="6"
sizeMd="6"
sizeLg="3"
sizeXl="3"
key={related_product.id}
>
<ProductCard product={related_product} />
</IonCol>
);
})}
</IonRow>
</IonGrid>
</IonCol>
</IonRow>
</IonGrid>
);
};
Expand Down

0 comments on commit 48e60d7

Please sign in to comment.