mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 06:09:45 +00:00
кликабельный заголовок -> переход на стр
This commit is contained in:
1 parent
75646a6784
commit
7d69ef0693
2 files changed
+43
-4
No files matched your search
@@ -6,6 +6,14 @@
|
||||
line-height: 44px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 8px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s ease;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #072AC8;
|
||||
}
|
||||
|
||||
@include mediaMax($tablet-max-width) {
|
||||
font-size: 24px;
|
||||
|
||||
@@ -10,6 +10,17 @@ import {
|
||||
transformPostsToCardData,
|
||||
} from "@/widgets/CardList/CardListFunctions";
|
||||
import { usePostProjects } from "@/modules/posts/hooks/usePostProjects";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useEffect } from "react";
|
||||
|
||||
// Компонент для прокрутки вверх при переходе
|
||||
const ScrollToTopOnMount = () => {
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
interface ListProps {
|
||||
gridConfig?: GridConfig;
|
||||
@@ -22,6 +33,8 @@ const NewsList = ({
|
||||
const { data: newsData, isLoading, isError } = useNews();
|
||||
|
||||
return (
|
||||
<>
|
||||
<ScrollToTopOnMount />
|
||||
<WithLoading
|
||||
isLoading={isLoading}
|
||||
isError={isError}
|
||||
@@ -34,11 +47,16 @@ const NewsList = ({
|
||||
items={transformNewsToCardData(newsData)}
|
||||
variant="news"
|
||||
gridConfig={gridConfig}
|
||||
title="Новости"
|
||||
title={
|
||||
<Link to="/news" className={styles.title} onClick={() => window.scrollTo(0, 0)}>
|
||||
Новости
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</WithLoading>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -49,6 +67,8 @@ const LabsList = ({
|
||||
const labs = postsData?.labs ? Object.values(postsData.labs) : [];
|
||||
|
||||
return (
|
||||
<>
|
||||
<ScrollToTopOnMount />
|
||||
<WithLoading
|
||||
isLoading={isLoading}
|
||||
isError={isError}
|
||||
@@ -59,10 +79,15 @@ const LabsList = ({
|
||||
items={transformPostsToCardData(labs)}
|
||||
variant="lab"
|
||||
gridConfig={gridConfig}
|
||||
title="Наши лаборатории"
|
||||
title={
|
||||
<Link to="/labs" className={styles.title} onClick={() => window.scrollTo(0, 0)}>
|
||||
Наши лаборатории
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</WithLoading>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -74,6 +99,8 @@ const ProjectsList = ({
|
||||
const projects = data ?? [];
|
||||
|
||||
return (
|
||||
<>
|
||||
<ScrollToTopOnMount />
|
||||
<WithLoading
|
||||
isLoading={isLoading}
|
||||
isError={isError}
|
||||
@@ -81,14 +108,18 @@ const ProjectsList = ({
|
||||
>
|
||||
<div className={styles.mainContainer}>
|
||||
<CardListTemplate
|
||||
//@ts-ignore
|
||||
items={transformPostsToCardData(projects)}
|
||||
variant="project"
|
||||
gridConfig={gridConfig}
|
||||
title="Наши проекты"
|
||||
title={
|
||||
<Link to="/projects" className={styles.title} onClick={() => window.scrollTo(0, 0)}>
|
||||
Наши проекты
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</WithLoading>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user