diff --git a/src/app/@types/bridge.d.ts b/src/app/@types/bridge.d.ts index 5b6c528..5c27684 100644 --- a/src/app/@types/bridge.d.ts +++ b/src/app/@types/bridge.d.ts @@ -57,6 +57,8 @@ import { import { DevHistoryDayResponse, DevHistoryGetDayRequest, + GitActivityForMonthRequest, + GitActivityForMonthResponse, } from '../../electron/devHistory/channels/MessageTypes' declare global { @@ -156,5 +158,10 @@ declare global { message: DevHistoryGetDayRequest, ) => Promise } + GitActivityForMonth: { + invoke: ( + message: GitActivityForMonthRequest, + ) => Promise + } } } diff --git a/src/app/MarketingWeek/Calendar.tsx b/src/app/MarketingWeek/Calendar.tsx index 960061f..f1b08c9 100644 --- a/src/app/MarketingWeek/Calendar.tsx +++ b/src/app/MarketingWeek/Calendar.tsx @@ -18,6 +18,7 @@ import { subMonths, addMonths, } from 'date-fns' +import { useGitActivityGetMonth } from './ReactQueryWrappers' const firstDayOfMonth = new Date(2023, 8, 1) let nearestMonday = new Date(firstDayOfMonth) @@ -98,6 +99,11 @@ export default function Calendar({ setOpenDateActions: React.Dispatch> date: Date }) { + const { data: gitActivity } = useGitActivityGetMonth({ + startDate: days[0]?.jsDate, + endDate: days.at(-1)?.jsDate, + }) + const container = useRef(null) const containerNav = useRef(null) const containerOffset = useRef(null) @@ -297,6 +303,10 @@ export default function Calendar({
{days.map((day, dayIdx) => { day.isSelected = isSameDay(day.jsDate, date) + const hasGitActivity = + gitActivity?.activity.get(day.jsDate.getTime()) && + '!bg-green-500' + return (