From 65c3c88aef89a1190ff45c26157b38e7ae3e092f Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 19 Oct 2023 20:15:02 -0700 Subject: [PATCH] Additional hover on title, not date --- src/widgets/calendar/agenda.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/widgets/calendar/agenda.jsx b/src/widgets/calendar/agenda.jsx index a96bd707..4d319bb0 100644 --- a/src/widgets/calendar/agenda.jsx +++ b/src/widgets/calendar/agenda.jsx @@ -6,21 +6,21 @@ import { IoMdCheckmarkCircleOutline } from "react-icons/io"; import { EventContext } from "../../utils/contexts/calendar"; -function formatDate(date, i18n) { - return date.setLocale(i18n.language).startOf("day").toLocaleString({ month: "short", day: "numeric" }); -} export function Event({ event, colorVariants, i18n }) { const title = event.title.length > 42 ? `${event.title.slice(0, 42)}...` : event.title; const [hover, setHover] = useState(false); - const onHover = () => setHover(!hover); return (
setHover(!hover)} + onMouseLeave={() => setHover(!hover)} > - - {hover ? event.additional : formatDate(event.date, i18n)} + + + {event.date.setLocale(i18n.language).startOf("day").toLocaleString({ month: "short", day: "numeric" })} + - {title} + {hover && event.additional ? event.additional : title} {event.isCompleted && (