added on hover that almost works!
This commit is contained in:
parent
e7e8c6efdd
commit
1ed22b60f5
@ -169,13 +169,15 @@ export const CourseCard = ({ course }: CourseCardProps) => {
|
|||||||
onClick={() => onGroupClick(group, course.id)}
|
onClick={() => onGroupClick(group, course.id)}
|
||||||
onMouseEnter={() => {
|
onMouseEnter={() => {
|
||||||
if (group.type === GroupType.CLASS && courseClasses !== undefined) {
|
if (group.type === GroupType.CLASS && courseClasses !== undefined) {
|
||||||
changeHoveredGroup(courseClasses);
|
|
||||||
changeGroupInBasket(group, course.id);
|
changeGroupInBasket(group, course.id);
|
||||||
|
// setTimeout(()=> { changeHoveredGroup(courseClasses)},[500])
|
||||||
|
|
||||||
}
|
}
|
||||||
if (group.type === GroupType.LECTURE && courseLecture !== undefined) {
|
if (group.type === GroupType.LECTURE && courseLecture !== undefined) {
|
||||||
changeHoveredGroup(courseLecture);
|
|
||||||
changeGroupInBasket(group, course.id);
|
changeGroupInBasket(group, course.id);
|
||||||
|
// setTimeout(()=> { changeHoveredGroup(courseLecture)},[500])
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
onMouseLeave={() => {
|
onMouseLeave={() => {
|
||||||
if (hoveredGroup) {
|
if (hoveredGroup) {
|
||||||
|
@ -137,6 +137,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => {
|
|||||||
basket.map((basket) => (basket.id === basketCourse.id ? { ...basket, lecture: choosenGroup } : basket)),
|
basket.map((basket) => (basket.id === basketCourse.id ? { ...basket, lecture: choosenGroup } : basket)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
changeHoveredGroup(choosenGroup);
|
||||||
};
|
};
|
||||||
|
|
||||||
const restoreGroupInBasket = (restoreGroup: Group, courseId: number) => {
|
const restoreGroupInBasket = (restoreGroup: Group, courseId: number) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user