From 62338cf73517a720d4986ab2e9ff9ed75ef13213 Mon Sep 17 00:00:00 2001 From: Lucid Kobold Date: Thu, 3 Feb 2022 12:45:11 -0600 Subject: [PATCH] Remove stickers from caledner context. Rename main state. --- contexts/CalenderContext.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/contexts/CalenderContext.tsx b/contexts/CalenderContext.tsx index c1488e5..e135e1e 100644 --- a/contexts/CalenderContext.tsx +++ b/contexts/CalenderContext.tsx @@ -73,9 +73,7 @@ const CalenderContextProvider = ({ return { isOverflow: flag, overflowDirection: direction }; }; - const [stickersMonth, setStickersMonth] = useState( - stickersSeeder() - ); + const [month /*, setMonth*/] = useState(stickersSeeder()); /** * A function that will return a month layout when given a date. It produces @@ -131,12 +129,11 @@ const CalenderContextProvider = ({ const overflowInfo = isOverflow(selectedDate, sunCurrDate); const stickerDay = overflowInfo.isOverflow ? null - : stickersMonth[getDate(sunCurrDate) - 1]; + : month[getDate(sunCurrDate) - 1]; const day: MonthDay = { ...overflowInfo, - date: sunCurrDate, - sticker: stickerDay ? stickerDay.sticker : null + date: sunCurrDate }; sunCurrDate = add(sunCurrDate, { @@ -169,12 +166,11 @@ const CalenderContextProvider = ({ const overflowInfo = isOverflow(selectedDate, monCurrDate); const stickerDay = overflowInfo.isOverflow ? null - : stickersMonth[getDate(monCurrDate) - 1]; + : month[getDate(monCurrDate) - 1]; const day: MonthDay = { ...overflowInfo, - date: monCurrDate, - sticker: stickerDay ? stickerDay.sticker : null + date: monCurrDate }; monCurrDate = add(monCurrDate, {