From 036a39febbc48eb2109109c7f5227f9f6312e9c9 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 15 Jan 2020 08:19:55 +0000 Subject: [PATCH] Show if a class is cancelled --- webclient/src/Classes.js | 4 ++-- webclient/src/Courses.js | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/webclient/src/Classes.js b/webclient/src/Classes.js index bc5505e..bed8047 100644 --- a/webclient/src/Classes.js +++ b/webclient/src/Classes.js @@ -32,7 +32,7 @@ function ClassTable(props) { {moment.utc(x.datetime).format('ll')} - {moment.utc(x.datetime).format('LT')} + {x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).format('LT')} {x.instructor_name} {x.cost === '0.00' ? 'Free' : '$'+x.cost} {x.student_count} @@ -126,7 +126,7 @@ export function ClassDetail(props) { Time: - {moment.utc(clazz.datetime).format('LT')} + {clazz.is_cancelled ? 'Cancelled' : moment.utc(clazz.datetime).format('LT')} diff --git a/webclient/src/Courses.js b/webclient/src/Courses.js index 0f089f4..08d28f5 100644 --- a/webclient/src/Courses.js +++ b/webclient/src/Courses.js @@ -76,9 +76,6 @@ export function CourseDetail(props) { }); }, []); - const getInstructor = (session) => - session.instructor ? session.instructor.first_name : session.old_instructor; - return ( {!error ? @@ -119,8 +116,8 @@ export function CourseDetail(props) { {moment.utc(x.datetime).format('ll')} - {moment.utc(x.datetime).format('LT')} - {getInstructor(x)} + {x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).format('LT')} + {x.instructor_name} {x.cost === '0.00' ? 'Free' : '$'+x.cost} )