diff --git a/components/agility-modules/FeaturedProduct.tsx b/components/agility-modules/FeaturedProduct.tsx new file mode 100644 index 000000000..c0383b075 --- /dev/null +++ b/components/agility-modules/FeaturedProduct.tsx @@ -0,0 +1,86 @@ +import React, { FC } from 'react' +import { URLField, Module, ImageField, AgilityImage } from "@agility/nextjs" +import Link from 'next/link' +import Image from "next/image" + + +interface Fields { + title: string + description: string + cTA?: URLField + product: string + image: ImageField + imagePosition: 'left' | 'right' + +} + +const HeroModule: Module = ({ module: { fields } }) => { + + const productJSON = fields.product + const product = JSON.parse(productJSON) + + return ( +
+
+
+ {fields.cTA ? ( + + + + ) : ( + + )} + + + + {product.name} + + + +
+
+
+ {product && ( + + {product.name} + + )} +

+ {fields.title} +

+

+ {fields.description} +

+ {fields.cTA && + + + {fields.cTA.text} + + + } +
+
+
+
+ ) +} + +export default HeroModule + diff --git a/components/agility-modules/index.ts b/components/agility-modules/index.ts index 8224bc6d8..7d7aa9ec3 100644 --- a/components/agility-modules/index.ts +++ b/components/agility-modules/index.ts @@ -12,6 +12,7 @@ import Profile from "./Profile" import Wishlist from "./Wishlist" import BlogPostListing from "./BlogPostListing" import BlogPostDetails from "./BlogPostDetails" +import FeaturedProduct from "./FeaturedProduct" const allModules = [ @@ -27,7 +28,8 @@ const allModules = [ { name: "Profile", module: Profile }, { name: "Wishlist", module: Wishlist }, { name: "BlogPostListing", module: BlogPostListing }, - { name: "BlogPostDetails", module: BlogPostDetails } + { name: "BlogPostDetails", module: BlogPostDetails }, + { name: "FeaturedProduct", module: FeaturedProduct } ]