Show if a class is cancelled

master
Tanner Collin 4 years ago
parent 2040875fe0
commit 036a39febb
  1. 4
      webclient/src/Classes.js
  2. 7
      webclient/src/Courses.js

@ -32,7 +32,7 @@ function ClassTable(props) {
{moment.utc(x.datetime).format('ll')}
</Link>
</Table.Cell>
<Table.Cell>{moment.utc(x.datetime).format('LT')}</Table.Cell>
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).format('LT')}</Table.Cell>
<Table.Cell>{x.instructor_name}</Table.Cell>
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
<Table.Cell>{x.student_count}</Table.Cell>
@ -126,7 +126,7 @@ export function ClassDetail(props) {
<Table.Row>
<Table.Cell>Time:</Table.Cell>
<Table.Cell>
{moment.utc(clazz.datetime).format('LT')}
{clazz.is_cancelled ? 'Cancelled' : moment.utc(clazz.datetime).format('LT')}
</Table.Cell>
</Table.Row>
<Table.Row>

@ -76,9 +76,6 @@ export function CourseDetail(props) {
});
}, []);
const getInstructor = (session) =>
session.instructor ? session.instructor.first_name : session.old_instructor;
return (
<Container>
{!error ?
@ -119,8 +116,8 @@ export function CourseDetail(props) {
{moment.utc(x.datetime).format('ll')}
</Link>
</Table.Cell>
<Table.Cell>{moment.utc(x.datetime).format('LT')}</Table.Cell>
<Table.Cell>{getInstructor(x)}</Table.Cell>
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).format('LT')}</Table.Cell>
<Table.Cell>{x.instructor_name}</Table.Cell>
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
</Table.Row>
)

Loading…
Cancel
Save