Removed unused imports

This commit is contained in:
Lucid Kobold
2022-04-11 14:15:41 -05:00
parent a256cbd1e3
commit 76c0dfca91
3 changed files with 7 additions and 11 deletions

View File

@@ -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"
}}

View File

@@ -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]);

View File

@@ -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<Date>(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<Date>(new Date());
const calenderContextValues: CalenderContextState = {
currDate,