Merge pull request #4 from ramyareye/woocommerce-framework

Woocommerce framework
This commit is contained in:
Reza Babaei
2021-09-18 22:25:56 +03:00
committed by GitHub
3 changed files with 9 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ const HomeAllProductsGrid: FC<Props> = ({
</Link>
</li>
{categories.map((cat: any) => (
<li key={cat.path} className="py-1 text-accent-8 text-base">
<li key={cat.path} className="py-1 text-base text-accent-8">
<Link href={getCategoryPath(cat.path)}>
<a>{cat.name}</a>
</Link>
@@ -42,7 +42,7 @@ const HomeAllProductsGrid: FC<Props> = ({
</Link>
</li>
{brands.flatMap(({ node }: any) => (
<li key={node.path} className="py-1 text-accent-8 text-base">
<li key={node.path} className="py-1 text-base text-accent-8">
<Link href={getDesignerPath(node.path)}>
<a>{node.name}</a>
</Link>

View File

@@ -5,7 +5,7 @@ import type { Product } from '@commerce/types/product'
import s from './ProductCard.module.css'
import Image, { ImageProps } from 'next/image'
import WishlistButton from '@components/wishlist/WishlistButton'
// import usePrice from '@framework/product/use-price'
import usePrice from '@framework/product/use-price'
import ProductTag from '../ProductTag'
interface Props {
@@ -25,11 +25,11 @@ const ProductCard: FC<Props> = ({
noNameTag = false,
variant = 'default',
}) => {
// const { price } = usePrice({
// amount: product.price.value,
// baseAmount: product.price.retailPrice,
// currencyCode: product.price.currencyCode!,
// })
const { price } = usePrice({
amount: product.price.value,
baseAmount: product.price.retailPrice,
currencyCode: product.price.currencyCode!,
})
const rootClassName = cn(
s.root,
@@ -74,7 +74,7 @@ const ProductCard: FC<Props> = ({
<span>{product.name}</span>
</h3>
<div className={s.price}>
{/* {`${price} ${product.price?.currencyCode}`} */}
{`${price} ${product.price?.currencyCode}`}
</div>
</div>
)}