Show if a class is cancelled

This commit is contained in:
Tanner Collin 2020-01-15 08:19:55 +00:00
parent 2040875fe0
commit 036a39febb
2 changed files with 4 additions and 7 deletions

View File

@ -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>

View File

@ -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>
)