Hide student count denominator if zero

This commit is contained in:
Tanner Collin 2020-02-14 22:35:24 +00:00
parent ca69ddf6f1
commit 4145ed3cc8

View File

@ -37,7 +37,7 @@ function ClassTable(props) {
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).local().format('LT')}</Table.Cell> <Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).local().format('LT')}</Table.Cell>
<Table.Cell>{x.instructor_name}</Table.Cell> <Table.Cell>{x.instructor_name}</Table.Cell>
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell> <Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
<Table.Cell>{x.student_count} {x.max_students && '/ '+x.max_students}</Table.Cell> <Table.Cell>{x.student_count} {!!x.max_students && '/ '+x.max_students}</Table.Cell>
</Table.Row> </Table.Row>
) )
: :
@ -174,7 +174,7 @@ export function ClassDetail(props) {
</Table.Row> </Table.Row>
<Table.Row> <Table.Row>
<Table.Cell>Students:</Table.Cell> <Table.Cell>Students:</Table.Cell>
<Table.Cell>{clazz.student_count} {clazz.max_students && '/ '+clazz.max_students}</Table.Cell> <Table.Cell>{clazz.student_count} {!!clazz.max_students && '/ '+clazz.max_students}</Table.Cell>
</Table.Row> </Table.Row>
</Table.Body> </Table.Body>
</BasicTable> </BasicTable>