fix(ui): multiple instructors are formatted properly, displays last name only, and are capitalized in all course blocks (#342) (#403)

* fix(ui): updated multiple instructor name formatting in course blocks

* fix(ui): display instructor last names only in all course blocks

* refactor: use instructor toString when getting instructor full name

* refactor: toString in useFlattenedCourseSchedule without template literal

Co-authored-by: Samuel Gunter <29130894+Samathingamajig@users.noreply.github.com>

* refactor: delete type hint and unnecessary comments

* fix(ui): instructor names semicolon delimiter in calendar course block

* fix(ui): removed 'unknown' when there are no instructors

* fix(ui): change - to &ndash

* fix(ui): changed - to ndash in hook

---------

Co-authored-by: Samuel Gunter <29130894+Samathingamajig@users.noreply.github.com>
This commit is contained in:
adityamkk
2024-10-29 16:07:26 -05:00
committed by GitHub
parent b3ae91d8f3
commit 50e88fa015
3 changed files with 10 additions and 10 deletions

View File

@@ -78,8 +78,9 @@ export default function PopupCourseBlock({
<DragIndicatorIcon className='h-6 w-6 text-white' />
</div>
<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} &ndash;{' '}
{course.instructors.length === 0 ? 'Unknown' : course.instructors.map(v => v.lastName)}
<span className='px-0.5 font-450'>{formattedUniqueId}</span> {course.department} {course.number}
{course.instructors.length > 0 ? <> &ndash; </> : ''}
{course.instructors.map(v => v.toString({ format: 'last', case: 'capitalize' })).join('; ')}
</Text>
{enableCourseStatusChips && course.status !== Status.OPEN && (
<div