Browse Source

add image lazy load

master
azri 1 week ago
parent
commit
4a09ba7c29
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/components/ProductList/ProductList.jsx

+ 5
- 2
src/components/ProductList/ProductList.jsx View File

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

Loading…
Cancel
Save