lazy loading added to the news scrool

This commit is contained in:
Kakabay 2023-01-31 16:09:16 +05:00
parent 10c6c6fa1b
commit c919b74911
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
// Modules
import { Link } from 'react-router-dom';
import { LazyLoadImage } from 'react-lazy-load-image-component';
// Images
import { ReactComponent as ArrRight } from '../../assets/icons/arrow-right.svg';
// Components
@ -20,13 +21,13 @@ const News = ({ title, text, category, date, img, link }: Props) => {
<div className="news">
<div className="news-wrapper">
<div className="news-image">
<img src={img} alt="img" />
<LazyLoadImage src={img} alt="image" useIntersectionObserver effect="blur" />
</div>
<div className="news-info">
<div className="news-info-inner">
<h2 className="news-title">{title}</h2>
<div className="news-status">
<NewsCategory title="Политика" link="" />
<NewsCategory title={category} link="" />
<NewsDate date={date} />
</div>
<div className="news-text">{text}</div>