fix: no hover on mobile

main
Antonio De Lucreziis 2 years ago
parent 82c21d2af9
commit d2f143133e

@ -21,8 +21,10 @@ export const Course = ({ events, selection, setSelection, hideOtherCourses }) =>
useEffect(() => { useEffect(() => {
if (element.current) { if (element.current) {
const l = e => { const l = e => {
const isMobile = window.matchMedia('(pointer: coarse)').matches
const $course = e.target.closest('.course') const $course = e.target.closest('.course')
if ($course) { if ($course && !isMobile) {
setCurrentlyHovered($course.dataset.courseId) setCurrentlyHovered($course.dataset.courseId)
} else { } else {
setCurrentlyHovered(null) setCurrentlyHovered(null)

Loading…
Cancel
Save