mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 06:29:45 +00:00
Все и сразу, давно делал, лень разбираться
This commit is contained in:
1 parent
4978c36070
commit
ab9438b5b9
32 files changed
+389
-120
No files matched your search
@@ -12,10 +12,14 @@ function Main() {
|
||||
|
||||
useEffect(() => {
|
||||
const navbar = document.getElementById("navbar");
|
||||
navbar.classList.add('transparent'); // Mount
|
||||
if (navbar) {
|
||||
navbar.classList.add('transparent');
|
||||
}
|
||||
|
||||
return () => {
|
||||
navbar.classList.remove('transparent'); // Unmount
|
||||
if (navbar) {
|
||||
navbar.classList.remove('transparent');
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@import "../../assets/styles/theme.scss";
|
||||
|
||||
$news-card-gap: 1em;
|
||||
|
||||
#react-page:has(> #mainpageheader) {
|
||||
margin-top: 0;
|
||||
|
||||
@@ -66,9 +68,15 @@
|
||||
color: $text-primary;
|
||||
}
|
||||
}
|
||||
|
||||
#news .row {
|
||||
grid-template-columns: repeat(4, calc((100% - $news-card-gap * 3) / 4));
|
||||
justify-content: space-between;
|
||||
gap: $news-card-gap;
|
||||
}
|
||||
}
|
||||
|
||||
.block:not(:last-child) {
|
||||
.block:not(:last-child) {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,11 @@
|
||||
import BlockHeading from '../BlockHeading';
|
||||
import NewsCard from './NewsCard';
|
||||
import './News.styles.scss';
|
||||
import { newsMock } from '../../../../assets/images';
|
||||
|
||||
const mock = [
|
||||
{
|
||||
id: 1,
|
||||
text: "Какая-то новость",
|
||||
image: newsMock
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
text: "Еще одна новость",
|
||||
image: newsMock
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
text: "Новость поменбше",
|
||||
image: newsMock
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
text: "Новость маленькая совсем жестб а текст какой длинный ого",
|
||||
image: newsMock
|
||||
},
|
||||
];
|
||||
|
||||
function News({ news = mock }) {
|
||||
import NewsList from '../../../../components/News';
|
||||
|
||||
function News() {
|
||||
return (
|
||||
<div className="block" id="news">
|
||||
<BlockHeading heading='Новости' linkText='Все новости' link='https://vk.com/skbkit' />
|
||||
<div className="row">
|
||||
{ news.map(item => <NewsCard key={ item.id } news={ item } />) }
|
||||
</div>
|
||||
<BlockHeading heading='Новости' linkText='Все новости' link='/news' />
|
||||
<NewsList isMainPage={ true } />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
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;
|
||||
Reference in new issue
Block a user