mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:09:45 +00:00
Рефакторинг получения записей и медиа. Все нужные корректировки в зависимый код внесены
This commit is contained in:
1 parent
1c5ace468a
commit
b07b5ee57e
10 files changed
+69
-99
No files matched your search
@@ -10,15 +10,15 @@ import './Footer.styles.scss';
|
||||
|
||||
const mockLinks = {
|
||||
ictis: {
|
||||
image: iconIctis,
|
||||
src: iconIctis,
|
||||
to: "https://ictis.sfedu.ru",
|
||||
},
|
||||
sfedu: {
|
||||
image: iconSfedu,
|
||||
src: iconSfedu,
|
||||
to: "https://sfedu.ru",
|
||||
},
|
||||
vk: {
|
||||
image: iconVK,
|
||||
src: iconVK,
|
||||
to: "https://vk.com/skbkit",
|
||||
},
|
||||
};
|
||||
@@ -36,6 +36,7 @@ function Footer({ links = mockLinks, contacts = mockContacts }) {
|
||||
const loadData = async () => {
|
||||
const newMediaList = await getMedia('footer', mediaList);
|
||||
setMediaList(newMediaList);
|
||||
console.log('footerMedia', newMediaList);
|
||||
};
|
||||
loadData();
|
||||
}, []);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
|
||||
function FooterLink({ link }) {
|
||||
return (
|
||||
<Link to={ link.to } className="link" target="_blank">
|
||||
<img src={ link.image } alt='icon' className='icon'/>
|
||||
<img src={ link.src } alt='icon' className='icon'/>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ function LabCard({ lab }) {
|
||||
return (
|
||||
<Link className="card lab" to={'/labs/' + lab.id}>
|
||||
<img src={lab.preview} alt="" className="image" />
|
||||
<div className="content">
|
||||
<div className="card-content">
|
||||
<h2>{lab.name}</h2>
|
||||
<div className="hidden">
|
||||
<p>{lab.previewText}</p>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
transition: opacity .2s ease-out;
|
||||
}
|
||||
|
||||
.content {
|
||||
.card-content {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
inset: auto 20px 10px 20px;
|
||||
@@ -62,11 +62,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:hover .content {
|
||||
&:hover .card-content {
|
||||
bottom: 20px;
|
||||
}
|
||||
|
||||
&:hover .content .hidden {
|
||||
&:hover .card-content .hidden {
|
||||
max-height: 200px;
|
||||
opacity: 1;
|
||||
transition: max-height 0.3s ease-out, opacity .1s ease-in;
|
||||
|
||||
@@ -17,6 +17,7 @@ function Slider({ autoPlay = 0, autoPlayTime = 0 }) {
|
||||
const loadData = async () => {
|
||||
const newMediaList = await getMedia('gallery');
|
||||
setMediaList(newMediaList);
|
||||
console.log('sliderMedia', newMediaList)
|
||||
};
|
||||
loadData();
|
||||
}, []);
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function SlidesList() {
|
||||
style={{ transform: `translateX(-${slideNumber * 100}%)` }}
|
||||
>
|
||||
{mediaList.map((slide, index) => (
|
||||
<Slide key={index} slide={slide.image} />
|
||||
<Slide key={index} slide={slide.src} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user