-
{price}
+
{price} {currencyCode}
@@ -80,4 +89,4 @@ const ProductCard = ({
)
}
-export default ProductCard
+export default ProductCardComponent
diff --git a/src/components/modules/home/FreshProducts/FreshProducts.tsx b/src/components/modules/home/FreshProducts/FreshProducts.tsx
index b06138079..33b872032 100644
--- a/src/components/modules/home/FreshProducts/FreshProducts.tsx
+++ b/src/components/modules/home/FreshProducts/FreshProducts.tsx
@@ -1,101 +1,15 @@
+import { ProductCard } from '@commerce/types/product'
import { Product } from '@framework/schema'
import React from 'react'
import { CollectionCarcousel } from '..'
-import image5 from '../../../../../public/assets/images/image5.png'
-import image6 from '../../../../../public/assets/images/image6.png'
-import image7 from '../../../../../public/assets/images/image7.png'
-import image8 from '../../../../../public/assets/images/image8.png'
interface FreshProductsProps {
- data: Product[]
+ data: ProductCard[]
}
-const dataTest = [
- {
- name: 'Tomato',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image5.src,
- },
- {
- name: 'Cucumber',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image6.src,
- },
- {
- name: 'Carrot',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image7.src,
- },
- {
- name: 'Salad',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image8.src,
- },
- {
- name: 'Tomato',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image5.src,
- },
- {
- name: 'Cucumber',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image6.src,
- },
- {
- name: 'Tomato',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image5.src,
- },
- {
- name: 'Cucumber',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image6.src,
- },
- {
- name: 'Carrot',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image7.src,
- },
- {
- name: 'Salad',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image8.src,
- },
- {
- name: 'Tomato',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image5.src,
- },
- {
- name: 'Cucumber',
- weight: '250g',
- category: 'VEGGIE',
- price: 'Rp 27.500',
- imageSrc: image6.src,
- },
-]
-const FreshProducts = ({data}: FreshProductsProps) => {
+const FreshProducts = ({ data }: FreshProductsProps) => {
+ if (data.length === 0) {
+ return null
+ }
return (
{
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/>
-
-
-
-
-
)
}
diff --git a/src/components/modules/home/HomeCollection/HomeCollection.tsx b/src/components/modules/home/HomeCollection/HomeCollection.tsx
index bd1cd33d6..4753f9ebe 100644
--- a/src/components/modules/home/HomeCollection/HomeCollection.tsx
+++ b/src/components/modules/home/HomeCollection/HomeCollection.tsx
@@ -1,10 +1,13 @@
import React from 'react'
+import { ProductCard } from '@commerce/types/product'
import { CollectionCarcousel } from '..'
import image5 from '../../../../../public/assets/images/image5.png'
import image6 from '../../../../../public/assets/images/image6.png'
import image7 from '../../../../../public/assets/images/image7.png'
import image8 from '../../../../../public/assets/images/image8.png'
-interface HomeCollectionProps {}
+interface HomeCollectionProps {
+ data: ProductCard[]
+}
const dataTest = [
{
name: 'Tomato',
@@ -92,47 +95,39 @@ const dataTest = [
},
]
-const HomeCollection = (props: HomeCollectionProps) => {
+const HomeCollection = ({data}: HomeCollectionProps) => {
return (
-