Parcourir la source

add image lazy load

master
azri il y a 1 semaine
Parent
révision
4a09ba7c29
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5
    2
      src/components/ProductList/ProductList.jsx

+ 5
- 2
src/components/ProductList/ProductList.jsx Voir le fichier

@@ -193,13 +193,15 @@ const ProductList = ({ size = 99999 }) => {
193 193
             position: "relative",
194 194
             cursor: "pointer",
195 195
           }}
196
-          onClick={()=>{
196
+          onClick={() => {
197 197
             navigate(`/products/${handle}`)
198 198
           }}
199 199
         >
200
+
200 201
           <img
201 202
             src={img_url}
202 203
             alt={title}
204
+            loading="lazy"
203 205
             style={{
204 206
               width: "100%",
205 207
               aspectRatio: "3 / 4",
@@ -208,6 +210,7 @@ const ProductList = ({ size = 99999 }) => {
208 210
             }}
209 211
           />
210 212
 
213
+
211 214
           {selected && (
212 215
             <Button
213 216
               sx={{
@@ -289,7 +292,7 @@ const ProductList = ({ size = 99999 }) => {
289 292
             >
290 293
               {`${minDiscountPriceCurrency} ${parseFloat(minDiscountPrice).toFixed(2)}`}
291 294
             </Typography>}
292
-            
295
+
293 296
 
294 297
           </Box>
295 298
         </Box>

Chargement…
Annuler
Enregistrer