news component made link

This commit is contained in:
Kakabay 2023-02-07 10:26:49 +05:00
parent 28bac07612
commit e737be0dff
2 changed files with 12 additions and 21 deletions

View File

@ -1,16 +1,12 @@
// Modules
import { Link } from "react-router-dom";
import { Link } from 'react-router-dom';
interface Props {
title: string;
}
const NewsCategory = ({ title }: Props) => {
return (
<Link to={`/category/asd`} className="news-category">
{title}
</Link>
);
return <span className="news-category">{title}</span>;
};
export default NewsCategory;

View File

@ -1,11 +1,11 @@
// Modules
import { Link } from "react-router-dom";
import { LazyLoadImage } from "react-lazy-load-image-component";
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";
import { ReactComponent as ArrRight } from '../../assets/icons/arrow-right.svg';
// Components
import NewsCategory from "../global/NewsCategory";
import NewsDate from "../global/NewsDate";
import NewsCategory from '../global/NewsCategory';
import NewsDate from '../global/NewsDate';
interface Props {
title: string;
@ -17,15 +17,10 @@ interface Props {
const News = ({ title, text, category, date, img }: Props) => {
return (
<div className="news">
<Link to={`/news/1`} className="news">
<div className="news-wrapper">
<div className="news-image">
<LazyLoadImage
src={img}
alt="image"
useIntersectionObserver
effect="blur"
/>
<LazyLoadImage src={img} alt="image" useIntersectionObserver effect="blur" />
</div>
<div className="news-info">
<div className="news-info-inner">
@ -36,12 +31,12 @@ const News = ({ title, text, category, date, img }: Props) => {
</div>
<div className="news-text">{text}</div>
</div>
<Link to={`/news/1`} className="news-link">
{/* <Link to={`/news/1`} className="news-link">
<span>прочитать все</span> <ArrRight />
</Link>
</Link> */}
</div>
</div>
</div>
</Link>
);
};