summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-11-07 09:16:51 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-11-07 09:16:51 +0700
commit982a18543beefdd33f20c294b06b7a1a87103b2f (patch)
tree987fd87023206bc8af20899f86415f5224751f90 /src-migrate/modules/product-detail/components
parent273f79e0e75cab92a5072819c03b38762b0cff03 (diff)
<iman> update mobile image
Diffstat (limited to 'src-migrate/modules/product-detail/components')
-rw-r--r--src-migrate/modules/product-detail/components/Image.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src-migrate/modules/product-detail/components/Image.tsx b/src-migrate/modules/product-detail/components/Image.tsx
index 29710df8..96ae2027 100644
--- a/src-migrate/modules/product-detail/components/Image.tsx
+++ b/src-migrate/modules/product-detail/components/Image.tsx
@@ -35,10 +35,12 @@ const Image = ({ product }: Props) => {
}, [flashSale?.remaining_time]);
const duration = moment.duration(count, 'seconds');
- console.log('product', product);
const image = useMemo(() => {
- if (isMobile && product.image_mobile) {
+ if (!isDesktop && product.image_mobile) {
return product.image_mobile + '?ratio=square';
+ } else {
+ if (product.image) return product.image + '?ratio=square';
+ return '/images/noimage.jpeg';
}
}, [product.image, product.image_mobile]);