fix: instructor formatting errors (#425)
* fix: instructor formatting errors * refactor: simplify logic in Instructor toString, remove unused formatters * refactor: remove "unnecessary" else's after returns I think it looks worse like this but whatever
This commit is contained in:
@@ -84,7 +84,7 @@ export default function PopupCourseBlock({
|
||||
<Text className={clsx('flex-1 py-3.5 truncate', fontColor)} variant='h1-course'>
|
||||
<span className='px-0.5 font-450'>{formattedUniqueId}</span> {course.department} {course.number}
|
||||
{course.instructors.length > 0 ? <> – </> : ''}
|
||||
{course.instructors.map(v => v.toString({ format: 'last', case: 'capitalize' })).join('; ')}
|
||||
{course.instructors.map(v => v.toString({ format: 'last' })).join('; ')}
|
||||
</Text>
|
||||
{enableCourseStatusChips && course.status !== Status.OPEN && (
|
||||
<div
|
||||
|
||||
@@ -55,8 +55,7 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
|
||||
const formattedUniqueId = uniqueId.toString().padStart(5, '0');
|
||||
const isInCalendar = useCalendar();
|
||||
|
||||
const getInstructorFullName = (instructor: Instructor) =>
|
||||
instructor.toString({ format: 'first_last', case: 'capitalize' });
|
||||
const getInstructorFullName = (instructor: Instructor) => instructor.toString({ format: 'first_last' });
|
||||
|
||||
const handleCopy = () => {
|
||||
navigator.clipboard.writeText(formattedUniqueId);
|
||||
|
||||
@@ -98,9 +98,7 @@ function extractCourseInfo(course: Course) {
|
||||
|
||||
if (course.instructors.length > 0) {
|
||||
courseDeptAndInstr += ' \u2013 ';
|
||||
courseDeptAndInstr += course.instructors
|
||||
.map(instructor => instructor.toString({ format: 'last', case: 'capitalize' }))
|
||||
.join('; ');
|
||||
courseDeptAndInstr += course.instructors.map(instructor => instructor.toString({ format: 'last' })).join('; ');
|
||||
}
|
||||
|
||||
return { status, courseDeptAndInstr, meetings, course };
|
||||
|
||||
Reference in New Issue
Block a user