Рефакторинг: Projects, News, индексирование, папки

This commit is contained in:
ifraimka1 committed 2024-02-16 12:57:07 +03:00
1 parent e4dd391568
commit e164d515bb
19 files changed
+140 -62

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
import BlockHeading from '../BlockHeading';
import NewsCard from './NewsCard';
import './News.styles.scss';
import { newsMock } from '../../../../images';
const mock = [
{
text: "Какая-то новость",
image: newsMock
},
{
text: "Еще одна новость",
image: newsMock
},
{
text: "Новость поменбше",
image: newsMock
},
{
text: "Новость маленькая совсем жестб а текст какой длинный ого",
image: newsMock
},
];
function News({ news = mock }) {
return (
<div className="block news">
<BlockHeading heading='Новости' linkText='Все новости' link='https://vk.com/skbkit' />
<div className="row">
{ news.map(item => <NewsCard news={ item } />) }
</div>
</div>
);
}
export default News;
+25
View File
@@ -0,0 +1,25 @@
.news {
.row {
display: flex;
justify-content: space-between;
gap: 32px;
.card {
width: 350px;
margin-bottom: 1em;
.pic {
width: 100%;
aspect-ratio: 1;
margin-bottom: .5em;
.image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 8px;
}
}
}
}
}
@@ -0,0 +1,12 @@
function NewsCard({ news }) {
return (
<div className="card">
<div className='pic'>
<img className='image' src={news.image} alt="news_image" ></img>
</div>
{ news.text }
</div>
);
}
export default NewsCard;
+1
View File
@@ -0,0 +1 @@
export { default } from './News';