diff --git a/src/pages/Contact/Contact.tsx b/src/pages/Contact/Contact.tsx index e0cf22e..ccba046 100644 --- a/src/pages/Contact/Contact.tsx +++ b/src/pages/Contact/Contact.tsx @@ -40,17 +40,19 @@ function Contact() {
- + ); } 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 diff --git a/src/widgets/CardList/types.ts b/src/widgets/CardList/types.ts index 49d8837..eb9a095 100644 --- a/src/widgets/CardList/types.ts +++ b/src/widgets/CardList/types.ts @@ -18,5 +18,5 @@ export interface CardListProps { items: Record; // Объект объектов variant?: "lab" | "news" | "project"; gridConfig?: GridConfig; - title: string; + title: string | React.ReactNode; } diff --git a/src/widgets/NewSlider/NewSlider.tsx b/src/widgets/NewSlider/NewSlider.tsx index b8b2bed..c9e54d6 100644 --- a/src/widgets/NewSlider/NewSlider.tsx +++ b/src/widgets/NewSlider/NewSlider.tsx @@ -10,8 +10,6 @@ import "./NewSlider.scss"; import { SliderContext, SliderProps } from "@/widgets/NewSlider/context"; function NewSlider({ - autoPlay = false, - autoPlayTime = 3000, images, category = "gallery", }: SliderProps) { @@ -78,7 +76,17 @@ function NewSlider({ if (filteredMedia.length === 0) return
Нет изображений
; return ( - + { + carouselRef.current?.slideTo(index); + setSlideNumber(index); + }, + slidesCount: filteredMedia.length, + }} + >
{shouldShowControls && (
diff --git a/src/widgets/Partners/Partners.module.scss b/src/widgets/Partners/Partners.module.scss index 595a361..769e606 100644 --- a/src/widgets/Partners/Partners.module.scss +++ b/src/widgets/Partners/Partners.module.scss @@ -48,7 +48,7 @@ $logo-size: 200px; .logo { width: $logo-size; height: $logo-size; - border-radius: 50%; + //border-radius: 50%; object-fit: cover; pointer-events: none; }