From 672144b097d13bb104543057559ccbcdf945d8f4 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Mon, 26 Aug 2024 14:13:10 -0600 Subject: [PATCH] pre codemon --- nextjs/next.config.mjs | 1 - .../src/app/course/[courseName]/CalendarMonth.tsx | 15 +++++++++------ nextjs/src/app/course/[courseName]/Day.tsx | 7 +++---- nextjs/src/app/course/[courseName]/page.tsx | 3 ++- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/nextjs/next.config.mjs b/nextjs/next.config.mjs index 1b2621c..4cb30e9 100644 --- a/nextjs/next.config.mjs +++ b/nextjs/next.config.mjs @@ -2,6 +2,5 @@ const nextConfig = { }; -devServer.fastRefresh = true; export default nextConfig; diff --git a/nextjs/src/app/course/[courseName]/CalendarMonth.tsx b/nextjs/src/app/course/[courseName]/CalendarMonth.tsx index 71813aa..ca12443 100644 --- a/nextjs/src/app/course/[courseName]/CalendarMonth.tsx +++ b/nextjs/src/app/course/[courseName]/CalendarMonth.tsx @@ -1,13 +1,16 @@ -"use client" -import { FC, useState } from "react"; +"use client"; +import { useState } from "react"; import { CalendarMonthModel } from "./calendarMonthUtils"; import { DayOfWeek, LocalCourse } from "@/models/local/localCourse"; -import { Day } from "./Day"; +import Day from "./Day"; -export const CalendarMonth: FC<{ +export default function CalendarMonth({ + month, + localCourse, +}: { month: CalendarMonthModel; localCourse: LocalCourse; -}> = ({ month, localCourse }) => { +}) { const [isCollapsed, setIsCollapsed] = useState(false); const isInPast = @@ -60,4 +63,4 @@ export const CalendarMonth: FC<{ ); -}; +} diff --git a/nextjs/src/app/course/[courseName]/Day.tsx b/nextjs/src/app/course/[courseName]/Day.tsx index ce62caf..0744d95 100644 --- a/nextjs/src/app/course/[courseName]/Day.tsx +++ b/nextjs/src/app/course/[courseName]/Day.tsx @@ -1,9 +1,8 @@ -"use client" -import React, { FC } from "react"; +"use client"; -export const Day: FC<{ day?: Date }> = ({ day }) => { +export default function Day({ day }: { day?: Date }) { const classes = "border rounded rounded-3 p-2 pb-4 m-1 "; if (!day) return
; return
{day.getDate()}
; -}; +} diff --git a/nextjs/src/app/course/[courseName]/page.tsx b/nextjs/src/app/course/[courseName]/page.tsx index e13ea1c..3952112 100644 --- a/nextjs/src/app/course/[courseName]/page.tsx +++ b/nextjs/src/app/course/[courseName]/page.tsx @@ -2,7 +2,8 @@ import { useLocalCourseDetailsQuery } from "@/hooks/localCoursesHooks"; import { getDateFromStringOrThrow } from "@/models/local/timeUtils"; import { getMonthsBetweenDates } from "./calendarMonthUtils"; -import { CalendarMonth } from "./CalendarMonth"; +import CalendarMonth from "./CalendarMonth"; + export default function Page({ params: { courseName },