Getting and setting completed tutorial cookie. Working on properly setting and updating a loading state.

This commit is contained in:
Lucid Kobold
2022-06-20 18:27:37 -05:00
parent 0cf317a9bc
commit 099c71876b
6 changed files with 152 additions and 25 deletions

View File

@@ -7,7 +7,17 @@ import findValidDateRange from "../../../lib/findValidDateRange";
import DatePicker from "./DatePicker";
import { useAppSelector } from "../../app/hooks";
const CalenderNav = (): JSX.Element => {
interface CalenderNavProps {
isLoading: boolean;
title: string;
}
/**
* @param {boolean} isLoading is the component loading?
* @param {string} title the title for the current date.
*/
const CalenderNav = ({ title, isLoading }: CalenderNavProps): JSX.Element => {
const selectedDate = useAppSelector(
(state) => state.calender.selectedDateInfo
);
@@ -46,7 +56,7 @@ const CalenderNav = (): JSX.Element => {
icon={<Icon icon="akar-icons:chevron-left" />}
onClick={() => handleNavButtons("prev")}
/>
<DatePicker />
<DatePicker isLoading={isLoading} title={title} />
<IconButton
isDisabled={isSameMonth(selectedDateObj, validEnd)}
aria-label="Next Month"