diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-07 09:16:51 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-07 09:16:51 +0700 |
| commit | 982a18543beefdd33f20c294b06b7a1a87103b2f (patch) | |
| tree | 987fd87023206bc8af20899f86415f5224751f90 /src-migrate/modules/product-detail | |
| parent | 273f79e0e75cab92a5072819c03b38762b0cff03 (diff) | |
<iman> update mobile image
Diffstat (limited to 'src-migrate/modules/product-detail')
| -rw-r--r-- | src-migrate/modules/product-detail/components/Image.tsx | 6 |
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]); |
