From 76c0dfca91c2966bd950adaf3fce7d4abf09cc86 Mon Sep 17 00:00:00 2001 From: Lucid Kobold <72232219+LucidKobold@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:15:41 -0500 Subject: [PATCH] Removed unused imports --- components/calender/Day.tsx | 9 ++------- components/calender/index.tsx | 5 +++-- contexts/CalenderContext.tsx | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/components/calender/Day.tsx b/components/calender/Day.tsx index 62e9d5b..dd24233 100644 --- a/components/calender/Day.tsx +++ b/components/calender/Day.tsx @@ -5,7 +5,6 @@ import { getMonth, sub, getDate, - isSameDay, isBefore, endOfDay } from "date-fns"; @@ -94,9 +93,7 @@ const Day = ({ w="100%" h="100%" _hover={{ - cursor: isBefore(date, endOfDay(currDate)) - ? "pointer" - : "default", + cursor: isBefore(date, endOfDay(currDate)) ? "pointer" : "default", background: "gray.700", border: "1px solid #FFF", color: "whiteAlpha.900" @@ -135,9 +132,7 @@ const Day = ({ justifyContent="flex-start" pt={2} _hover={{ - cursor: isBefore(date, endOfDay(currDate)) - ? "pointer" - : "default", + cursor: isBefore(date, endOfDay(currDate)) ? "pointer" : "default", background: "gray.700", border: "1px solid #FFF" }} diff --git a/components/calender/index.tsx b/components/calender/index.tsx index 524a294..c70819d 100644 --- a/components/calender/index.tsx +++ b/components/calender/index.tsx @@ -7,7 +7,8 @@ import CalenderNav from "./CalenderNav"; import Day from "./Day"; const Calender = (newDate?: UpdateCalendarProps): JSX.Element => { - const { selectedDate, layout, updateDate, currDate, setCurrDate } = useContext(CalenderContext); + const { selectedDate, layout, updateDate, currDate, setCurrDate } = + useContext(CalenderContext); const { stickersMonth } = useContext(StickersContext); useEffect(() => { @@ -25,7 +26,7 @@ const Calender = (newDate?: UpdateCalendarProps): JSX.Element => { useEffect(() => { console.info("Check to update date."); if (!isSameDay(currDate, new Date())) { - console.info("Updated date.") + console.info("Updated date."); setCurrDate(new Date()); } }, [currDate, setCurrDate]); diff --git a/contexts/CalenderContext.tsx b/contexts/CalenderContext.tsx index 799bba3..da8f6a4 100644 --- a/contexts/CalenderContext.tsx +++ b/contexts/CalenderContext.tsx @@ -240,8 +240,8 @@ const CalenderContextProvider = ({ } }; - // * Attempting to fix an issue with static generation where the date does not appear to be updating after initial generation. - const [currDate, setCurrDate] = useState(new Date); + // * Attempting to fix an issue with static generation where the date does not appear to be updating after initial generation. + const [currDate, setCurrDate] = useState(new Date()); const calenderContextValues: CalenderContextState = { currDate,