diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-11-01 10:40:36 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-11-01 10:40:36 +0700 |
| commit | 410b363883cc8b441bc2a858825ade07d72a19ca (patch) | |
| tree | c39d9fbc13381e5ac5b67f37b5d8aa6a194c745c /src/components/productCard.js | |
| parent | 83354e3e9af77447a399b1f47fa22c7fccbbbe72 (diff) | |
Add progress bar and performance optimization
Diffstat (limited to 'src/components/productCard.js')
| -rw-r--r-- | src/components/productCard.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/productCard.js b/src/components/productCard.js index 6e703670..f51473ad 100644 --- a/src/components/productCard.js +++ b/src/components/productCard.js @@ -1,13 +1,17 @@ import Link from "next/link"; import currencyFormat from "../helpers/currencyFormat"; import { createSlug } from "../helpers/slug"; +import { LazyLoadImage } from "react-lazy-load-image-component"; + +import 'react-lazy-load-image-component/src/effects/blur.css'; + export default function productCard({ data }) { let product = data; return ( <div className="product-card"> <Link href={'/shop/product/' + createSlug(product.name, product.id)} className="block"> - <img src={product.image ? product.image : '/images/noimage.jpeg'} alt={product.name} className="product-card__image" loading="lazy" /> + <LazyLoadImage effect="blur" src={product.image ? product.image : '/images/noimage.jpeg'} alt={product.name} className="product-card__image" /> </Link> <div className="product-card__description"> <div> |
