From f7a32dbccbdefd478ed6bd6190bd4fa395eda720 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 6 Nov 2024 15:42:41 +0700 Subject: update mobile view --- src-migrate/modules/product-detail/components/Information.tsx | 2 +- src-migrate/modules/product-detail/components/PriceAction.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src-migrate') diff --git a/src-migrate/modules/product-detail/components/Information.tsx b/src-migrate/modules/product-detail/components/Information.tsx index 8655517d..590e8afd 100644 --- a/src-migrate/modules/product-detail/components/Information.tsx +++ b/src-migrate/modules/product-detail/components/Information.tsx @@ -189,7 +189,7 @@ const Information = ({ product }: Props) => { width={100} src={product.manufacture.logo} alt={product.manufacture.name} - className='h-8 object-cover' + className='h-8 object-fit' /> ) : ( diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index 3544fa26..dc384dda 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -7,6 +7,7 @@ import formatCurrency from '~/libs/formatCurrency'; import { IProductDetail } from '~/types/product'; import { useProductDetail } from '../stores/useProductDetail'; import AddToCart from './AddToCart'; +import useDevice from '@/core/hooks/useDevice'; type Props = { product: IProductDetail; @@ -25,7 +26,7 @@ const PriceAction = ({ product }: Props) => { selectedVariant, sla, } = useProductDetail(); - + const { isDesktop, isMobile } = useDevice(); useEffect(() => { setActive(selectedVariant); if (product.variants.length > 2 && product.variants[0].price.price === 0) { @@ -53,7 +54,10 @@ const PriceAction = ({ product }: Props) => { return (
{!!activePrice && activePrice.price > 0 && ( -- cgit v1.2.3