From 7d69ef0693037f3e23f8a03d646de604bb361a46 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Tue, 8 Jul 2025 16:43:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BB=D0=B8=D0=BA=D0=B0=D0=B1=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=D0=BE=D0=BA=20->=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/CardList/CardList.module.scss | 8 ++ src/widgets/CardList/CardList.tsx | 125 ++++++++++++++-------- 2 files changed, 86 insertions(+), 47 deletions(-) diff --git a/src/widgets/CardList/CardList.module.scss b/src/widgets/CardList/CardList.module.scss index 01b9602..8498dc9 100644 --- a/src/widgets/CardList/CardList.module.scss +++ b/src/widgets/CardList/CardList.module.scss @@ -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; diff --git a/src/widgets/CardList/CardList.tsx b/src/widgets/CardList/CardList.tsx index 4a11929..20e0726 100644 --- a/src/widgets/CardList/CardList.tsx +++ b/src/widgets/CardList/CardList.tsx @@ -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,23 +33,30 @@ const NewsList = ({ const { data: newsData, isLoading, isError } = useNews(); return ( - -
- {newsData && ( - - )} -
-
+ <> + + +
+ {newsData && ( + window.scrollTo(0, 0)}> + Новости + + } + /> + )} +
+
+ ); }; @@ -49,20 +67,27 @@ const LabsList = ({ const labs = postsData?.labs ? Object.values(postsData.labs) : []; return ( - -
- -
-
+ <> + + +
+ window.scrollTo(0, 0)}> + Наши лаборатории + + } + /> +
+
+ ); }; @@ -74,22 +99,28 @@ const ProjectsList = ({ const projects = data ?? []; return ( - -
- -
-
+ <> + + +
+ window.scrollTo(0, 0)}> + Наши проекты + + } + /> +
+
+ ); }; -export { NewsList, LabsList, ProjectsList }; +export { NewsList, LabsList, ProjectsList }; \ No newline at end of file