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