mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:19:45 +00:00
Рефакторинг: Projects, News, индексирование, папки
This commit is contained in:
1 parent
e4dd391568
commit
e164d515bb
19 files changed
+140
-62
No files matched your search
Executable
+37
@@ -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
@@ -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;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './News';
|
||||
Reference in new issue
Block a user