diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index e6fa084..8cbccc2 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -169,13 +169,15 @@ export const CourseCard = ({ course }: CourseCardProps) => { onClick={() => onGroupClick(group, course.id)} onMouseEnter={() => { if (group.type === GroupType.CLASS && courseClasses !== undefined) { - changeHoveredGroup(courseClasses); changeGroupInBasket(group, course.id); + // setTimeout(()=> { changeHoveredGroup(courseClasses)},[500]) + } if (group.type === GroupType.LECTURE && courseLecture !== undefined) { - changeHoveredGroup(courseLecture); changeGroupInBasket(group, course.id); + // setTimeout(()=> { changeHoveredGroup(courseLecture)},[500]) } + }} onMouseLeave={() => { if (hoveredGroup) { diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 4fe013b..d5b854a 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -137,6 +137,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { basket.map((basket) => (basket.id === basketCourse.id ? { ...basket, lecture: choosenGroup } : basket)), ); } + changeHoveredGroup(choosenGroup); }; const restoreGroupInBasket = (restoreGroup: Group, courseId: number) => {