Skip to content

Commit

Permalink
show red dots on home page (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
warreprovoost authored May 23, 2024
1 parent 50dfaaf commit c979408
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/pages/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import {
import { DateCalendar } from "@mui/x-date-pickers/DateCalendar";
import { DayCalendarSkeleton, LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import dayjs, { Dayjs } from "dayjs";
import { PickersDay, PickersDayProps } from "@mui/x-date-pickers/PickersDay";
import { ProjectDeadlineCard } from "../project/projectDeadline/ProjectDeadlineCard.tsx";
import { ProjectDeadline } from "../project/projectDeadline/ProjectDeadline.tsx";
import { useLoaderData } from "react-router-dom";
import { Me } from "../../types/me.ts";

interface DeadlineInfoProps {
selectedDay: Dayjs;
deadlines: ProjectDeadline[];
Expand Down Expand Up @@ -144,6 +143,11 @@ export default function HomePage() {
.sort((a, b) => dayjs(b.deadline).diff(dayjs(a.deadline)))
.slice(0, 3); // only show the first 3
const noDeadlineProject = projects.filter((p) => p.deadline === undefined);

useEffect(() => {
handleMonthChange(selectedDay, projects, setHighlightedDays);
}, [projects, selectedDay]);

return (
<Container style={{ paddingTop: "50px" }}>
<Grid container spacing={2} wrap="nowrap">
Expand Down

0 comments on commit c979408

Please sign in to comment.