diff --git a/components/calender/Day.tsx b/components/calender/Day.tsx index 2c028e6..456bd57 100644 --- a/components/calender/Day.tsx +++ b/components/calender/Day.tsx @@ -12,6 +12,15 @@ interface DayProps { selectedDate: Date; } +/** + * The individual days in the calender component. + * @param props the props for this component. + * @param {boolean} props.isOverflow is the current date being given before or after the current month. + * @param {"next" | "prev" | null} props.overflowDirection the direction the overflow is. This will navigate the calender forward or backwards 1 month. + * @param {-2 | -1 | 0 | 1 | 2 | null} props.sticker the sticker for this date. + * @param {date} props.date the date for this day. + * @param {date} props.selectedDate the date for the selected month. + */ const Day = (props: DayProps): JSX.Element => { const { isOverflow, overflowDirection, /*sticker,*/ date, selectedDate } = props; @@ -35,6 +44,7 @@ const Day = (props: DayProps): JSX.Element => { } }; + // This handles the modal for this date. const [isOpen, setIsOpen] = useState(false); return ( diff --git a/components/calender/modals/AddSticker.tsx b/components/calender/modals/AddSticker.tsx index b48a5d8..378a404 100644 --- a/components/calender/modals/AddSticker.tsx +++ b/components/calender/modals/AddSticker.tsx @@ -18,9 +18,26 @@ interface AddStickerProps { date: Date; } +/** + * Handles adding and modifying the stickers for the given month. + * @param props the props for this component. + * @param {boolean} props.isOpen tells the component when the modal should be open. + * @param {React.Dispatch>} props.updateIsOpen used to close the modal. + * @param {date} props.date the date for which the sticker will be added or modified. + */ const AddSticker = (props: AddStickerProps): JSX.Element => { const { isOpen, updateIsOpen, date } = props; + // TODO: Import the stickers array from the calender context. + + // TODO: Add a function that will add or update the sticker for the current date. + + /** + * TODO: Add logic into the contents of the modal to show messages if the selected date is out of range. + * Show a message when a date in the future is selected. + * Show a message when a date before the current date is selected. + */ + return (