From 2fb6992325e21a83c30db9cde9baae6a124ba0d5 Mon Sep 17 00:00:00 2001 From: cade Date: Tue, 20 Aug 2024 12:36:52 -0600 Subject: [PATCH] add indication for incomplete previous module --- app/_components/event-form.tsx | 18 +++++++++++++----- app/_components/module-card.tsx | 8 ++++---- app/_components/session-page.tsx | 8 ++++---- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/_components/event-form.tsx b/app/_components/event-form.tsx index b50f96f2..3fc8fe02 100644 --- a/app/_components/event-form.tsx +++ b/app/_components/event-form.tsx @@ -28,7 +28,6 @@ import { twMerge } from 'tailwind-merge'; interface EventFormProps { className?: string; - disabled?: boolean; event?: | NonNullable | NonNullable['modules'][0]['event'][0]; @@ -38,6 +37,7 @@ interface EventFormProps { | NonNullable['modules'][0]; isArchived?: boolean; isMission?: boolean; + isPreviousModulePending?: boolean; isPublic?: boolean; subjectId: string; } @@ -56,11 +56,11 @@ export interface EventFormValues { const EventForm = ({ className, - disabled, event, eventType, isArchived, isMission, + isPreviousModulePending, isPublic, subjectId, }: EventFormProps) => { @@ -301,13 +301,21 @@ const EventForm = ({ {(!event || form.formState.isDirty) && ( )} diff --git a/app/_components/module-card.tsx b/app/_components/module-card.tsx index bf19403e..52793d68 100644 --- a/app/_components/module-card.tsx +++ b/app/_components/module-card.tsx @@ -13,10 +13,10 @@ import EventComments, { } from '@/_components/event-comments'; interface ModuleCardProps { - disabled?: boolean; event?: NonNullable['modules'][0]['event'][0]; eventType: NonNullable['modules'][0]; isArchived?: boolean; + isPreviousModulePending?: boolean; isPublic?: boolean; isTeamMember?: boolean; mission: NonNullable; @@ -25,10 +25,10 @@ interface ModuleCardProps { } const ModuleCard = ({ - disabled, event, eventType, isArchived, + isPreviousModulePending, isPublic, isTeamMember, mission, @@ -40,7 +40,7 @@ const ModuleCard = ({ return (
@@ -69,11 +69,11 @@ const ModuleCard = ({ )} {(event || (!isPublic && !isArchived)) && ( diff --git a/app/_components/session-page.tsx b/app/_components/session-page.tsx index 04310a29..be238e5c 100644 --- a/app/_components/session-page.tsx +++ b/app/_components/session-page.tsx @@ -116,7 +116,7 @@ const SessionPage = async ({
    {session.modules.map((module, i) => { const event = firstIfArray(module.event); - const previousModule = session.modules[i - 1]; + const previousModuleEvent = session.modules[i - 1]?.event; return (