From 1510f6725c5633ea1e91d62fe76039e27112624c Mon Sep 17 00:00:00 2001 From: Lucid Kobold Date: Thu, 3 Feb 2022 13:39:19 -0600 Subject: [PATCH] Dynamically render cursor and modal. Removed unused imports. --- components/calender/Day.tsx | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/components/calender/Day.tsx b/components/calender/Day.tsx index 991b349..adcb4fb 100644 --- a/components/calender/Day.tsx +++ b/components/calender/Day.tsx @@ -1,5 +1,14 @@ import { Box, Text, VStack } from "@chakra-ui/react"; -import { add, getYear, getMonth, sub, getDate, isSameDay, isBefore, endOfDay } from "date-fns"; +import { + add, + getYear, + getMonth, + sub, + getDate, + isSameDay, + isBefore, + endOfDay +} from "date-fns"; import router from "next/router"; import React, { Fragment, useState } from "react"; import { StickersContextProvider } from "../../contexts/StickerContext"; @@ -71,7 +80,9 @@ const Day = ({ w="100%" h="100%" _hover={{ - cursor: isBefore(date, endOfDay(new Date)) ? "pointer" : "default", + cursor: isBefore(date, endOfDay(new Date())) + ? "pointer" + : "default", background: "gray.700", border: "1px solid #FFF", color: "whiteAlpha.900" @@ -107,7 +118,9 @@ const Day = ({ justifyContent="flex-start" pt={2} _hover={{ - cursor: isBefore(date, endOfDay(new Date)) ? "pointer" : "default", + cursor: isBefore(date, endOfDay(new Date())) + ? "pointer" + : "default", background: "gray.700", border: "1px solid #FFF" }} @@ -137,11 +150,13 @@ const Day = ({ )} - {isBefore(date, endOfDay(new Date)) && - ( - - ) - } + {isBefore(date, endOfDay(new Date())) && ( + + )} )}