File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ import getCookie from '../utils/cookie'
66import { HeartIcon as HeartIconSolid } from '@heroicons/react/solid'
77import { HeartIcon } from '@heroicons/react/outline'
88import { classNames } from '../utils/styling'
9+ import { LazyLoadImage } from 'react-lazy-load-image-component' ;
10+ import 'react-lazy-load-image-component/src/effects/blur.css' ;
11+ import PlaceholderImage from '../assets/dummy_275x360_ffffff_cccccc.png' ;
912
1013function handleClick ( ) {
1114 sessionStorage . setItem ( 'scrollPosition' , window . pageYOffset )
@@ -65,11 +68,11 @@ const Item = (props) => {
6568 < div key = { item . id } data-id = { item . id } className = "group relative" >
6669 { item . image_url ? ( < div className = "w-full min-h-80 bg-gray-200 aspect-w-1 aspect-h-1 rounded-md overflow-hidden group-hover:opacity-75 lg:h-80 lg:aspect-none" >
6770
68- < img src = { item . image_url } alt = { item . name } className = "w-full h-full object-center object-cover lg:w-full lg:h-full" />
71+ < LazyLoadImage src = { item . image_url } alt = { item . name } height = { '100%' } width = { '100%' } placeholdersrc = { PlaceholderImage } className = "w-full h-full object-center object-cover lg:w-full lg:h-full" effect = "blur " />
6972
7073 </ div > ) : (
7174 < div className = "w-full min-h-80 bg-gray-200 aspect-w-1 aspect-h-1 rounded-md overflow-hidden group-hover:opacity-75 lg:h-80 lg:aspect-none" >
72- < img src = { item . image } alt = { item . name } className = "w-full h-full object-center object-cover lg:w-full lg:h-full" />
75+ < LazyLoadImage src = { item . image } alt = { item . name } placeholdersrc = { PlaceholderImage } className = "w-full h-full object-center object-cover lg:w-full lg:h-full" effect = "blur " />
7376 </ div >
7477 ) }
7578 < div className = "mt-4 flex justify-between" >
You can’t perform that action at this time.
0 commit comments